Access to Neuro plugin URL from Python plugin

Apologies if this is a repeat question. I could not find it discussed elsewhere.

I recently came across the Neuro plugin. Thanks, Sebastien!

I attempted to call it from within a script run by the Python plugin, but the attempt to call any series URL with nifti appended generates an error in that context.

I can successfully download NIFTI from the web interface. I have not yet tried using the external API.

Is the python plugin simply not aware of the neuro plugin if both are running? Would I need to import the requests module and construct a full URL (ex. https://myorthanc/series/ID/nifti) if I want to call the nifti plugin from within the python plugin?

Thanks,
John.

Dear John,

In your Python plugin, have you tried to replace your call to “orthanc.RestApiGet()” by “orthanc.RestApiGetAfterPlugins()”?

Indeed, calls to “orthanc.RestApiGet()” only access the built-in REST API of Orthanc, whereas “orthanc.RestApiGetAfterPlugins()” will use the REST API as tainted by the various installed plugins.

Kind Regards,
Sébastien-

Thanks, Sebastien, I forgot about that modified plugin call.

I was able to implement a requests approach, but I will try the AfterPlugins version as well.

On a related note, I am attempting to automate sending all series as NIFTI to a disk location.

Of course, some series (ex. reports) cannot be converted to NIFTI and I need to detect and skip them in the automated script. I see from other error responses that other particular types of DICOM are not yet supported for NIFTI conversion by the neuro plugin. They generate 400 errors during the API nifti call with “Not yet supported” messages. I am going to tally the list of non-conversions and dump a note to the users for which series could not be converted automatically.

Dear John,

Evidently, don’t hesitate to provide us with sample DICOM files that generate such 400 errors.

Regards,
Sébastien-