Giter Site home page Giter Site logo

gilbertobotaro / nifi-dicom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blezek/nifi-dicom

0.0 1.0 0.0 2.81 MB

DICOM handling for NiFi

License: MIT License

Java 97.40% HTML 0.21% Shell 0.06% XSLT 2.22% Smarty 0.10% Batchfile 0.01% CSS 0.01%

nifi-dicom's Introduction

DICOM for NiFi

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.

Building

# Run tests
./gradlew test
# Build the nar file, in build/libs
./gradlew nar

Install

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

Notes on Encryption

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 decryption
  • Iterations: 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 the DeidentifyEncryptDICOM password
  • Accept new series: if true, new series are allowed, otherwise they are rejected

Processors

DeidentifyDICOM

This processor implements a DICOM deidentifier. The DeidentifyDICOM processor substitutes DICOM tags with deidentified values and stores the values.

Properties:

  • Deidentification controller: Specified the deidentification controller for DICOM deidentification
  • Generate identification: Create generated identifiers if the patient name did not match the Identifier CSV file
  • Keep descriptors: Keep text description and comment attributes
  • Keep series descriptors: Keep the series description even if all other descriptors are removed
  • Keep protocol name: Keep protocol name even if all other descriptors are removed
  • Keep patient characteristics: Keep patient characteristics (such as might be needed for PET SUV calculations)
  • Keep device identity: Keep device identity
  • Keep institution identity: Keep institution identity
  • Keep 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

Relationships:

  • success: All deidentified DICOM images will be routed as FlowFiles to this relationship
  • not_matched: DICOM files that do not match the patient remapping are routed to this relationship
  • failure: FlowFiles that are not DICOM images

FlowFile attributes:

  • N/A: does not set attributes

ExtractDICOMTags

This processor extracts DICOM tags from the DICOM image and sets the values at attributes of the flowfile.

Properties:

  • Extract all DICOM tags: Extract all DICOM tags if true, only listed tags if false
  • Construct suggested filename: Construct a filename of the pattern 'PatientName/Modality_Date/SeriesNumber_SeriesDescription/SOPInstanceUID.dcm' with all unacceptable characters mapped to '_'

Relationships:

  • success: All DICOM images will be routed as FlowFiles to this relationship
  • failure: FlowFiles that are not DICOM images

FlowFile attributes:

  • N/A: does not set attributes

ListenDICOM

This processor implements a DICOM receiver to listen for incoming DICOM images.

Properties:

  • 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 Titles
  • Listening port: The TCP port the ListenDICOM processor will bind to.

Relationships:

  • success: All new DICOM images will be routed as FlowFiles to this relationship

FlowFile attributes:

  • dicom.calling.aetitle: The sending AE title
  • dicom.calling.hostname: The sending hostname
  • dicom.called.aetitle: The receiving AE title
  • dicom.called.hostname: The receiving hostname
  • dicom.called.hostname: The receiving hostname

PutDICOM

This processor implements a DICOM sender, sending DICOM images to the specified destination.

Properties:

  • 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

Relationships:

  • success: FlowFiles that are successfully sent will be routed to success
  • reject: FlowFiles that are not DICOM images
  • failure: FlowFiles that failed to send to the remote system; failure is usually looped back to this processor

FlowFile attributes:

  • N/A: does not set attributes

ModifyDICOMTags

This processor modifies DICOM tags.

Properties:

Relationships:

  • success: All modified DICOM images will be routed as FlowFiles to this relationship
  • failure: FlowFiles that are not DICOM images

FlowFile attributes:

  • N/A: does not set attributes

DeidentifyEncryptDICOM

This processor implements a DICOM deidentifier. Deidentified DICOM tags are encrypted using a password for later decription and re-identification.

Properties:

  • Encryption password: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encripted
  • Encryption iterations: Number of encription rounds. Higher number of iterations are typically more secure, but require more per-image computation
  • Keep descriptors: Keep text description and comment attributes
  • Keep series descriptors: Keep the series description even if all other descriptors are removed
  • Keep protocol name: Keep protocol name even if all other descriptors are removed
  • Keep patient characteristics: Keep patient characteristics (such as might be needed for PET SUV calculations)
  • Keep device identity: Keep device identity
  • Keep institution identity: Keep institution identity
  • Keep 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

Relationships:

  • success: All deidentified DICOM images will be routed as FlowFiles to this relationship
  • failure: FlowFiles that are not DICOM images

FlowFile attributes:

  • N/A: does not set attributes

DecryptReidentifyDICOM

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.

Properties:

  • Encryption password: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encripted
  • Accept 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 series
  • Batch size: Number of DICOM files to process in batch

Relationships:

  • success: All deidentified DICOM images will be routed as FlowFiles to this relationship
  • failure: FlowFiles that are not DICOM images
  • not decrypted: DICOM images that could not be sucessfully decrypted

FlowFile attributes:

  • N/A: does not set attributes

DeidentifyEncryptDICOM

This processor implements a DICOM deidentifier. Deidentified DICOM tags are encrypted using a password for later decription and re-identification.

Properties:

  • Encryption password: Encryption password, leave empty or unset if deidintified or removed attributes are not to be encripted
  • Encryption iterations: Number of encription rounds. Higher number of iterations are typically more secure, but require more per-image computation
  • Keep descriptors: Keep text description and comment attributes
  • Keep series descriptors: Keep the series description even if all other descriptors are removed
  • Keep protocol name: Keep protocol name even if all other descriptors are removed
  • Keep patient characteristics: Keep patient characteristics (such as might be needed for PET SUV calculations)
  • Keep device identity: Keep device identity
  • Keep institution identity: Keep institution identity
  • Keep 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

Relationships:

  • success: All deidentified DICOM images will be routed as FlowFiles to this relationship
  • failure: FlowFiles that are not DICOM images

FlowFile attributes:

  • N/A: does not set attributes

nifi-dicom's People

Contributors

blezek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.