Aiaa server returns auto-segmentation error "target_shape dimension must match image dimension" into 3D slicer

I am running clara train / AIAA server on aws

downloading the example segmentation “clara_ct_seg_spleen_amp” as followes:
ngc registry model download-version nvidia/med/clara_ct_seg_spleen_amp:1

curl -X PUT “http://127.0.0.1/admin/model/clara_ct_seg_spleen_amp” -F “config=@clara_ct_seg_spleen_amp_v1/config/config_aiaa.json;type=application/json” -F “data=@clara_ct_seg_spleen_amp_v1/models/model.trt.pb”

Version of 3d slicer 4.11.0-2020-04-21 r29000 / dfef957

the CT scan slices are of the following dimentions 512x512

In 3D slicer Segmentation Editor under Nvidia AIAA -> Auto-segmentation, Model: clara_ct_seg_spleen_amp I press Start (next to Nvidia logo)

PROBLEM:
after a few seconds I get this error returned from AIAA server:

Run Segmentation for model: clara_ct_seg_spleen_amp - Status: 500; Response: b’{“error”:{“message”:[“target_shape dimension must match image dimension”],“type”:“AssertionError”},“success”:false}\n’

Traceback (most recent call last):
File “C:/Users/Peter/AppData/Roaming/NA-MIC/Extensions-29000/NvidiaAIAssistedAnnotation/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorNvidiaAIAALib/SegmentEditorEffect.py”, line 390, in onClickSegmentation
extreme_points, result_file = self.logic.segmentation(in_file, session_id, model)
File “C:/Users/Peter/AppData/Roaming/NA-MIC/Extensions-29000/NvidiaAIAssistedAnnotation/lib/Slicer-4.11/qt-scripted-modules/SegmentEditorNvidiaAIAALib/SegmentEditorEffect.py”, line 1032, in segmentation
params = aiaaClient.segmentation(model, image_in, result_file, session_id=session_id)
File “C:\Users\Peter\AppData\Roaming\NA-MIC\Extensions-29000\NvidiaAIAssistedAnnotation\lib\Slicer-4.11\qt-scripted-modules\NvidiaAIAAClientAPI\client_api.py”, line 229, in segmentation
raise AIAAException(AIAAError.SERVER_ERROR, ‘Status: {}; Response: {}’.format(status, form))
NvidiaAIAAClientAPI.client_api.AIAAException: (3, ‘Status: 500; Response: b’{“error”:{“message”:[“target_shape dimension must match image dimension”],“type”:“AssertionError”},“success”:false}\n’’)

What is the dimension of your data?
is it 2D or 3D?

Can you try the spleen data downloaded from here: http://medicaldecathlon.com/
and share the result?

Hello Yuantingh,

Thank you for looking into this.
I am loading 195 jpg CT images into slicer they are of dimensions 512x512. I am pretty sure 3D slicer converts them into 3D slices. ie I can see/scan from top/side/front in 3D slicer.

I downloaded from your link Task09_Spleen.tar, unzipped and loaded the directory Task09_Spleen\Task09_Spleen\imagesTr

than select master_volume spleen_30
and the segmentation works (pressing start on the model) for your images

Hi Peter,

I guess you also have the same data in another thread.
Since JPG has a channel dimension of 3, that is why causing problem
Because our model is expecting a data with only 1 channel.

In your case we can write a custom transform that combine those 3 dimension into 1.
You can decide how you want to combine them.

You can refer to this part: https://docs.nvidia.com/clara/tlt-mi/clara-train-sdk-v3.0/aiaa/byom/byot.html
and share your findings here thank you