< All Topics
Print

Automating DICOM Data Integration with Apache NiFi: Get Zipped DICOM from an SFTP source

Table of Contents

Start by dragging the GetSFTP (or FetchSFTP) processor onto your canvas.

This processor securely connects to your SFTP server, enabling NiFi to retrieve ZIP files containing the DICOM images.
Double-click on the processor, go to settings tab, and name it “Get Dicom ZIP from SFTP” or whatever you feel suitable. We recommend user-friendly names for a better debug experience.

In the processor settings > properties tab, specify the server hostname (address IP or hostname of your SFTP server), port, and user credentials.

The remote default directory on the SFTP server is “/upload” and I’d like to fetch all files without any filter because I only have zip archives.

Click on the validate button, if all correctly setup the following message should appear:

If you wish that processed files should be deleted, then set “Delete original” to true.

You can also configure scheduling to run at regular intervals, ensuring NiFi continuously polls for new files.

Unpack files processor

Next, connect the SFTP processor’s output relationship to an UnpackContent processor to handle the ZIP files. This step automatically decompresses the incoming files, preparing each DICOM image for further processing—such as extracting tags or modifying metadata.

Setup a “Success” relationship between GetSFTP and UnpackContent by dragging the arrow from the first processor and drop it onto the second. A queue will be created between the 2 processors.

Set “terminate” for failure and original relationships

In the UnpackContent settings, specify the packaging format as zip and choose where to route any errors (e.g., an “error” relationship). Together, these two processors form the foundation of your pipeline, ensuring every DICOM file is securely retrieved and neatly unpacked for the rest of the workflow.

Now time to test our setup:

For simplicity, right click on SFTP processor and then click run once:

You should see your zip files queued successfully (1 zip file for this demo):