nifi-dicom
adds DICOM features to Apache's NiFi package. The new Processors
reside in a nar
file and extend NiFi with several new processors. The Processors
are self-documenting, with some details below.
The nar
file releases can be downloaded from GitHub.
# Run tests
./gradlew test
# Build the nar file, in build/libs
./gradlew nar
To install nifi-dicom
copy the nar
file into the lib
directory of your NiFi install and restart NiFi.
cp build/libs/nifi-dicom*.nar $NIFI_HOME/lib
DICOM Supplement 55 Attribute Level Confidentiality covers the proper procedure for deidentification of DICOM data, and potential later recovery of the original PHI. The secret sauce is to encrypt a set of tags and embed into the deidentified DICOM. Later, with the proper key or password, the data can be recovered.
A Nifi controller providing deidentification using the PixelMedNet DICOM Cleaner application. Removed or modified attributes are encrypted using the Bouncy Castle FIPS code (distributed with the source code).
To keep UID
remapping consistent, this processor needs to be associated with a DeidentificationService
.
DeidentifyEncryptDICOM
has these relevant properties:
Password
: password used to encrypt, needed for decryptionIterations
: number of iterations to use in encryption, more is better for security but costs CPU cycles
DecryptReidentifyDICOM
decrypts and reidentifies DICOM data. Must use the same password
as DeidentifyEncryptDICOM
or the data will not be recoverable. Has the option (Accept new series
) to preserve the SeriesInstanceUID
and SOPInstanceUID
in the deidentified data. This is mainly useful for analytics that create new series and instances.
Relevant properties:
Password
: password for decryption, must match theDeidentifyEncryptDICOM
passwordAccept new series
: iftrue
, new series are allowed, otherwise they are rejected
This processor implements a DICOM deidentifier. The DeidentifyDICOM processor substitutes DICOM tags with deidentified values and stores the values.
Deidentification controller
: Specified the deidentification controller for DICOM deidentificationGenerate identification
: Create generated identifiers if the patient name did not match the Identifier CSV fileKeep descriptors
: Keep text description and comment attributesKeep series descriptors
: Keep the series description even if all other descriptors are removedKeep protocol name
: Keep protocol name even if all other descriptors are removedKeep patient characteristics
: Keep patient characteristics (such as might be needed for PET SUV calculations)Keep device identity
: Keep device identityKeep institution identity
: Keep institution identityKeep private tags
: Keep all private tags. If set to 'false', all unsafe private tags are removed.Add contributing equipment sequence
: Add tags indicating the software used for deidentification
success
: All deidentified DICOM images will be routed as FlowFiles to this relationshipnot_matched
: DICOM files that do not match the patient remapping are routed to this relationshipfailure
: FlowFiles that are not DICOM images
- N/A: does not set attributes
This processor extracts DICOM tags from the DICOM image and sets the values at attributes of the flowfile. Note: this processor reads the entire file including all pixel data.
Extract all DICOM tags
: Extract all DICOM tags if true, only listed tags if falseConstruct suggested filename
: Construct a filename of the pattern 'PatientName/Modality_Date/SeriesNumber_SeriesDescription/SOPInstanceUID.dcm' with all unacceptable characters mapped to '_'<TagName>
: any named Tag, for instance,SeriesDescription
,PatientId
. Any Tag defined bydcm4che
is accessable. Missing Tags, or unknown Tags are ignored. Thedcm4che
Tags are generated dynamically from XML files
success
: All DICOM images will be routed as FlowFiles to this relationshipfailure
: FlowFiles that are not DICOM images
- N/A: does not set attributes
This processor implements a DICOM receiver to listen for incoming DICOM images.
Local Application Entity Title
: ListenDICOM requires that remote DICOM Application Entities use this AE Title when sending DICOM, default is to accept all called AE TitlesListening port
: The TCP port the ListenDICOM processor will bind to.
success
: All new DICOM images will be routed as FlowFiles to this relationship
dicom.calling.aetitle
: The sending AE titledicom.calling.hostname
: The sending hostnamedicom.called.aetitle
: The receiving AE titledicom.called.hostname
: The receiving hostnamedicom.called.hostname
: The receiving hostname
This processor implements a DICOM sender, sending DICOM images to the specified destination.
Remote Application Entity Title
:Remote hostname of remote DICOM destination
:Remote Port
: The TCP port to send to.Local Application Entity
:batch size
: maxmium number of DICOM images to send at once, 0 is unlimited
success
: FlowFiles that are successfully sent will be routed to successreject
: FlowFiles that are not DICOM imagesfailure
: FlowFiles that failed to send to the remote system; failure is usually looped back to this processor
- N/A: does not set attributes
This processor modifies DICOM tags. DICOM Tags listed as Properities are replaced by their value. Tags are named according to the ExtractDICOMTags
processor documented above.
<Tag>
: the value of the property is written as the value toTag
success
: All modified DICOM images will be routed as FlowFiles to this relationshipfailure
: FlowFiles that are not DICOM images
- N/A: does not set attributes
This processor implements a DICOM deidentifier. Deidentified DICOM tags are encrypted using a password for later decription and re-identification.
Encryption password
: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encriptedEncryption iterations
: Number of encription rounds. Higher number of iterations are typically more secure, but require more per-image computationKeep descriptors
: Keep text description and comment attributesKeep series descriptors
: Keep the series description even if all other descriptors are removedKeep protocol name
: Keep protocol name even if all other descriptors are removedKeep patient characteristics
: Keep patient characteristics (such as might be needed for PET SUV calculations)Keep device identity
: Keep device identityKeep institution identity
: Keep institution identityKeep private tags
: Keep all private tags. If set to 'false', all unsafe private tags are removed.Add contributing equipment sequence
: Add tags indicating the software used for deidentification
success
: All deidentified DICOM images will be routed as FlowFiles to this relationshipfailure
: FlowFiles that are not DICOM images
- N/A: does not set attributes
This processor implements a DICOM reidentifier. Previously deidintified DICOM files with Supplement 55 encrypted tags have the original tags decrypted and the reidentified image is written as a FlowFile.
Encryption password
: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encriptedAccept new series
: If the encrypted, generated Series and Instance UIDs do not match the DICOM object, assume this DICOM image is a new series generated from a deidentified, encrypted DICOM image. Decrypt the original tags, but do not replace the Series and SOPInstance UIDs, effectively creating a new seriesBatch size
: Number of DICOM files to process in batch
success
: All deidentified DICOM images will be routed as FlowFiles to this relationshipfailure
: FlowFiles that are not DICOM imagesnot decrypted
: DICOM images that could not be sucessfully decrypted
- N/A: does not set attributes
This processor implements a DICOM deidentifier. Deidentified DICOM tags are encrypted using a password for later decription and re-identification.
Encryption password
: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encriptedEncryption iterations
: Number of encription rounds. Higher number of iterations are typically more secure, but require more per-image computationKeep descriptors
: Keep text description and comment attributesKeep series descriptors
: Keep the series description even if all other descriptors are removedKeep protocol name
: Keep protocol name even if all other descriptors are removedKeep patient characteristics
: Keep patient characteristics (such as might be needed for PET SUV calculations)Keep device identity
: Keep device identityKeep institution identity
: Keep institution identityKeep private tags
: Keep all private tags. If set to 'false', all unsafe private tags are removed.Add contributing equipment sequence
: Add tags indicating the software used for deidentification
success
: All deidentified DICOM images will be routed as FlowFiles to this relationshipfailure
: FlowFiles that are not DICOM images
- N/A: does not set attributes