Convert to nifti using neuro plugin

Hi, I have been setting up Orthanc for the first time today.
Orthanc 1.12.6 using docker on a linux server.

I want to use this for automating a machine learning workflow using some Pytorch models that I have. So, I want to send images from MRI → DICOM node → convert to nifti format → run the nifti through some model and store the result in the Dicom node as nifti.

I was able to send some images to the server from the MR-machine. But when I tried the Neuro plugin, I get errors, more specifically this error:

{
"Details" : "Cannot detect the 3D coordinates in a multiframe instance",
"HttpError" : "Internal Server Error",
"HttpStatus" : 500,
"Message" : "Not implemented yet",
"Method" : "GET",
"OrthancError" : "Not implemented yet",
"OrthancStatus" : 2,
"Uri" : "/instances/65a288b1-e5d01b16-1e2c79d2-bc557297-02b093e9/nifti"
}

I also want to learn more about how I can use the REST APIs, possibly set up a script that detects a new series and performs conversions to nifti and runs the pytorch model and sends results back. But I am not so experienced with orthanc yet, so any tips would be appreciated.

Also if i choose a series with only one frame, I get:

{
	"HttpError" : "Internal Server Error",
	"HttpStatus" : 500,
	"Message" : "Not implemented yet",
	"Method" : "GET",
	"OrthancError" : "Not implemented yet",
	"OrthancStatus" : 2,
	"Uri" : "/instances/21cca72a-a9802772-995237fd-b68fb502-ec4995e2/nifti"
}

from the log:

E0319 18:01:18.385729           HTTP-1 PluginsErrorDictionary.cpp:101] Exception inside the plugin engine: Not implemented yet
W0319 18:01:27.251649           HTTP-6 EmbeddedResourceHttpHandler.cpp:81] Unable to find HTTP resource: /orthanc-logo.png
E0319 18:01:27.251774           HTTP-6 HttpOutput.cpp:80] This HTTP answer has not sent the proper number of bytes in its body.  The remote client has likely closed the connection.
E0319 18:01:52.716169          HTTP-17 PluginsErrorDictionary.cpp:101] Exception inside the plugin engine: Not implemented yet

Hello,

You will have to share sample DICOM files for us to be able to independently reproduce your issue. Note that the orthanc-neuro plugin is work-in-progress related to my research work.

As an alternative, you can download DICOM instances/series as numpy arrays using the built-in REST API. Evidently, such arrays can easily be used by PyTorch.

Regards,
Sébastien-

This particular DICOM is just a localizer series of a phantom bottle in the lab. The issue seems specific to data from Philips scanners — I’ve found that the “Survey” sequences are often split into multiple stacks or acquisition packages (“multiframe instance”). That fragmentation seems to cause the DICOM-to-NIfTI conversion to fail or produce unusable outputs.

That said, I’ve successfully managed to monitor new series externally, retrieve the DICOM files, convert them to NIfTI using dicom2nifti, and then run inference via MONAI. So far, I’ve been handling this using heuristics like checking NumberOfFrames > 1, verifying the presence of PixelData, and skipping known problematic protocols like ExamCard.

I’ll definitely explore the NumPy array export from Orthanc’s REST API — thanks for pointing that out.

I tried to upload the files here in the forum but received the message:

“Sorry, new users can not upload attachments.”

I’ll see if I can get clearance to share one of the problematic series with you — that would probably be the best way to help reproduce the issue.