protected class DeidentifyAndRedact.OurMediaImporter extends MediaImporter
A protected class that actually does all the work of finding and processing the files.
MediaImporter.MediaImporterWithFileChooserDialogThread, MediaImporter.OurReadTerminationStrategy
Modifier and Type | Field and Description |
---|---|
protected boolean |
canUseBzip |
logger, mediaDirectoryPath, progressBar, progressBarUpdater, terminateAfterIdentifyingGroup
Constructor and Description |
---|
OurMediaImporter(MessageLogger logger,
java.lang.String outputFolderName,
DeidentifyAndRedact.RedactionRegions redactionRegions,
boolean decompress,
boolean keepAllPrivate,
boolean addContributingEquipmentSequence,
AttributeList replacementAttributes,
java.util.Set<java.lang.String> failedSet)
Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doSomethingWithDicomFileOnMedia(java.lang.String dicomFileName,
java.lang.String inputTransferSyntaxUID,
java.lang.String sopClassUID)
Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.
|
java.util.Set<java.lang.String> |
getFilePathNamesThatFailedToProcess()
Get file names that failed to import.
|
protected boolean |
isOKToImport(java.lang.String sopClassUID,
java.lang.String transferSyntaxUID)
Allows all types of DICOM files, images or not, uncompressed or compressed, with supported Transfer Syntaxes to be processed
|
choosePathAndImportDicomFiles, choosePathAndImportDicomFiles, doSomethingWithDicomFileOnMedia, doSomethingWithUnwantedFileOnMedia, getDirectory, importDicomFiles, logLn, main
public OurMediaImporter(MessageLogger logger, java.lang.String outputFolderName, DeidentifyAndRedact.RedactionRegions redactionRegions, boolean decompress, boolean keepAllPrivate, boolean addContributingEquipmentSequence, AttributeList replacementAttributes, java.util.Set<java.lang.String> failedSet)
Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.
logger
- outputFolderName
- where to store all the processed output filesredactionRegions
- which regions to redact in all the processed filesdecompress
- decompress JPEG rather than try to avoid loss in unredacted blockskeepAllPrivate
- retain all private attributes, not just known safe onesaddContributingEquipmentSequence
- whether or not to add ContributingEquipmentSequencereplacementAttributes
- additional attributes with values to add or replace during de-identificationfailedSet
- set to add paths of files that failed to import (does not have to be empty; will be added to)protected void doSomethingWithDicomFileOnMedia(java.lang.String dicomFileName, java.lang.String inputTransferSyntaxUID, java.lang.String sopClassUID)
Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.
Implements the following options of ClinicalTrialsAttributes.removeOrNullIdentifyingAttributes()
:
keepDescriptors, keepSeriesDescriptors, keepProtocolName, keepPatientCharacteristics, keepDeviceIdentity, keepInstitutionIdentity, ClinicalTrialsAttributes.HandleDates.keep
Also performs AttributeList.removeUnsafePrivateAttributes()
Also performs ClinicalTrialsAttributes.remapUIDAttributes(AttributeList)
If the pixel data can be redacted without decompressing it (i.e., for Baseline JPEG), then that will be done, otherwise the pixel data will be decompressed and store in Explicit VR Little Endian Transfer Syntax.
The output file is stored in the outputFolderName specified in the constructor and is named by its SOP Instance UID, a suffix of _Anon" and an extension of ".dcm"
Any exceptions encountered during processing are logged to stderr, and processing of the next file will continue.
doSomethingWithDicomFileOnMedia
in class MediaImporter
dicomFileName
- the fully qualified path name to a DICOM fileinputTransferSyntaxUID
- the Transfer Syntax of the Data Set if a DICOM file, from the DICOMDIR or Meta Information HeadersopClassUID
- the SOP Class of the Data Set if a DICOM file, from the DICOMDIR or Meta Information Headerpublic java.util.Set<java.lang.String> getFilePathNamesThatFailedToProcess()
Get file names that failed to import.
protected boolean isOKToImport(java.lang.String sopClassUID, java.lang.String transferSyntaxUID)
Allows all types of DICOM files, images or not, uncompressed or compressed, with supported Transfer Syntaxes to be processed
isOKToImport
in class MediaImporter
sopClassUID
- transferSyntaxUID
-