Using nifty file as input for my MAP application #462
ArpanGyawali
started this conversation in
General
Replies: 1 comment 1 reply
-
@ArpanGyawali A Numpy array as the result of an image loader is never enough in the case of inference. The loader need to provide both the Numpy array as well as the metadata. Further, to fit what's expected by the built-in inference operators, an App SDK Image object is required, which really is just numpy array with a list of expected metadata. A more efficient implementation is actually do what's done in MONAI core, i.e. passing the file path to the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have created MAP for taking dicom data as input and get the segmentation for skull stripping task following the spleen seg inference application.
We have more data in nifty format than in dicom so I wanted to create a additional application or combine with the previous that takes nifty as well.
I tried using Nii_file_loader_operator but it returns numpy array(np.ndarray) and when i tried to give this output to skull_strip_operator(similar to spleen_seg_operator), as it takes monai.core.Image as input. So this raises an error
So i edited the Nii_file_loader_operator by just changing the type explicitly by
op_output.set(Image(image_np))
But this returns Image without any metadata headet so i got the error like
KeyError: 'row_pixel_spacing' thrown by LoadImaged pretransform.
What should i do so that my LoadImaged pretransform takes nifty image from my disk or numpy image returned by nifty_loader from InMemory.
Beta Was this translation helpful? Give feedback.
All reactions