Class DeidentifyAndRedact.OurMediaImporter
- Enclosing class:
DeidentifyAndRedact
A protected class that actually does all the work of finding and processing the files.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmed.dicom.MediaImporter
MediaImporter.MediaImporterWithFileChooserDialogThread, MediaImporter.OurReadTerminationStrategy
-
Field Summary
FieldsFields inherited from class com.pixelmed.dicom.MediaImporter
logger, mediaDirectoryPath, progressBar, progressBarUpdater, terminateAfterIdentifyingGroup
-
Constructor Summary
ConstructorsConstructorDescriptionOurMediaImporter
(MessageLogger logger, String outputFolderName, DeidentifyAndRedact.RedactionRegions redactionRegions, boolean decompress, boolean keepAllPrivate, boolean addContributingEquipmentSequence, AttributeList replacementAttributes, Set<String> failedSet) Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doSomethingWithDicomFileOnMedia
(String dicomFileName, String inputTransferSyntaxUID, String sopClassUID) Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.Get file names that failed to import.protected boolean
isOKToImport
(String sopClassUID, String transferSyntaxUID) Allows all types of DICOM files, images or not, uncompressed or compressed, with supported Transfer Syntaxes to be processedMethods inherited from class com.pixelmed.dicom.MediaImporter
choosePathAndImportDicomFiles, choosePathAndImportDicomFiles, doSomethingWithDicomFileOnMedia, doSomethingWithUnwantedFileOnMedia, getDirectory, importDicomFiles, logLn, main
-
Field Details
-
canUseBzip
protected boolean canUseBzip
-
-
Constructor Details
-
OurMediaImporter
public OurMediaImporter(MessageLogger logger, String outputFolderName, DeidentifyAndRedact.RedactionRegions redactionRegions, boolean decompress, boolean keepAllPrivate, boolean addContributingEquipmentSequence, AttributeList replacementAttributes, Set<String> failedSet) Deidentify both the DICOM Attributes and the Pixel Data using the RedactionRegions specified in the constructor.
- Parameters:
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)
-
-
Method Details
-
getFilePathNamesThatFailedToProcess
Get file names that failed to import.
- Returns:
- file names that failed to import (empty if did not fail)
-
doSomethingWithDicomFileOnMedia
protected void doSomethingWithDicomFileOnMedia(String dicomFileName, String inputTransferSyntaxUID, 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.
- Overrides:
doSomethingWithDicomFileOnMedia
in classMediaImporter
- Parameters:
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 Header
-
isOKToImport
Allows all types of DICOM files, images or not, uncompressed or compressed, with supported Transfer Syntaxes to be processed
- Overrides:
isOKToImport
in classMediaImporter
- Parameters:
sopClassUID
-transferSyntaxUID
-- Returns:
- true if is suitable
-