SlicerTomoSAM
SlicerTomoSAM copied to clipboard
Failed with int16 data
I downloaded data from the TCIA / IDC C4KC-KiTS dataset and loaded a CT series. I got the error below. The int16 data type is very common for real world data so it would be great if this module worked with it.
Creating SAM predictor ... Done
Slicing along x direction
Traceback (most recent call last):
File "/home/exouser/Downloads/Slicer-5.3.0-2023-07-08-linux-amd64/slicer.org/Extensions-31860/TomoSAM/lib/Slicer-5.3/qt-scripted-modules/tomosam.py", line 504, in onPushEmbeddingsCreate
self.ui.PathLineEdit_emb.currentPath = self.logic.create_embeddings(output_filepath)
File "/home/exouser/Downloads/Slicer-5.3.0-2023-07-08-linux-amd64/slicer.org/Extensions-31860/TomoSAM/lib/Slicer-5.3/qt-scripted-modules/tomosamLib/tomosamLogic.py", line 119, in create_embeddings
self.predictor.set_image(np.repeat(img_slice[:, :, np.newaxis], 3, axis=2))
File "/home/exouser/Downloads/Slicer-5.3.0-2023-07-08-linux-amd64/lib/Python/lib/python3.9/site-packages/segment_anything/predictor.py", line 56, in set_image
input_image = self.transform.apply_image(image)
File "/home/exouser/Downloads/Slicer-5.3.0-2023-07-08-linux-amd64/lib/Python/lib/python3.9/site-packages/segment_anything/utils/transforms.py", line 31, in apply_image
return np.array(resize(to_pil_image(image), target_size))
File "/home/exouser/Downloads/Slicer-5.3.0-2023-07-08-linux-amd64/lib/Python/lib/python3.9/site-packages/torchvision/transforms/functional.py", line 335, in to_pil_image
raise TypeError(f"Input type {npimg.dtype} is not supported")
TypeError: Input type int16 is not supported