Importing and exporting 3D TIFs

Hello.
I have received a CT scan in form of 3D tiff. It looks like a single image, but according to curator it contains all tiffs build in.
However, the Slicer seem to not be able to read it properly (see attached)
Also, I have tried to create my own 3d tiff in Slicer and try to load it. So I go to Data and save volume as a TIF (2th photo). One enormous tif was saved. But importing this to Slicer give the same result as in previous case, some super thin slices in Green and Yellow windows but single slice in Red.
Have anyone used Slicer to create such tiff format?
Best regards


tiff isn’t an ideal format for 3d volumes so we don’t use it a lot with Slicer. If you can, writing a small python script using an appropriate tiff library would be good. Otherwise maybe use FIJI to split it up into files and use the ImageStacks module in SlicerMorph to load it. Be sure you know the slice and pixel spacing of the sample.

Ok, I will try this.
Thanks!

@Kajper as I recall Slicer already supports multiframe TIFFs directly. You don’t need the ImageStacks to import the data. However, data loaded this will likely have incorrect image spacing. So after you loaded your file (just try drag and dropping into the slicer, and choose volume), go to Volumes module, check and edit the reported image spacing values and the immediately proceed to save the data a NRRD file to preserve the corrected values.

If you continue to keep them in TIFF format, those changes will be lost since TIFF cannot store that type of image geometry metadata.

@muratmaga @pieper thanks for help again. But it looks like the spacing is correct but the dimensions are wrong.
Of course normally I would store the CT in NRRD but I want to try to combine Slicer and BounTI (GitHub - Didziokas/BounTI), that allows for automatic bone segmentation, and the only format it accepts is this 3D TIFF.
Have you heard about analogous expansion for Slicer? I know there is a TotalSegmentator but I guess it works only on medical data (I tried it on the snake skull and does not work)

Did you try without the imagestacks? Imagestacks expects a sequence of images, not a single image with multiple frames. So it is reading only the first slice.

I just downloaded the sample multiframe tiff from the repository and dragged into slicer and as expected it loads perfectly fine but with wrong image spacing. This is also extremely simple segmentation task, I am not sure you need that iterative method to accomplish it.

@muratmaga this BounTI requires this 3D TIFF, not a image stack. I am not familiarised with this kind of files as usually I have my CT in a series of normal TIFF. BounTI should segment every single bone separately, like in the photo, so it is not that easy task. I work with Slicer a lot on different scans so this kind of automatization would be great.

You should be able to do all this in Slicer without needing any additional tool using a combination of functions such as:
threshold
margin operation
island tool
and grow from the seed.

This took 10 seconds from loading data to creating this:

You can continue from this point on using the grow from seed to separate the vertebra, and then probably use the margin tool a bit more aggressively to pull apart the individual cranial bones.

@muratmaga I am aware of these methods. For fossils, it is the only way and Slicer is doing a great job. But some kind of automatization is clearly possible for modern species where the boundaries between the bones are clear.

So I am lost what you are asking from us? You can automate these in Slicer. But if you want to use the other tool that’s fine do.

I’m fairly new to slicer and might be missing the nuance of your question. I have not tried saving a TIFF stack out of slicer (note that it’s not ideal to save your segments as TIFFs) but I was able to import a TIF stack into slicer doing the following… Open your single file TIFF stack in image J. Click Save as>image sequence (I found that 3d slicer only works when each slice is saved separately in one directory). Install and run slicermorph extension in 3D slicer and follow the instructions in this video. So far most the segmentation tools appear to be generally working on my TIFF file. https://www.youtube.com/watch?v=1xvevF8tBws

If you read my answer above (linked below), you will see that you do NOT need to do any of these, as you can directly load a multiframe TIFF file into Slicer without having to do anything with FiJi or ImageStacks module. The only thing you need to do is to correct the spacing.

1 Like

Thanks for reminding me to retry the simple method. Yes, importing the single file TIFF stack by dragging into Slicer works–no extensions needed. My Z voxel size was 100x the size and this was throwing me off as new user. As you probably state somewhere, I went to volumes and corrected the image spacing and everything looks in order. Cheers

Thats exactly the reason Slicer does not want to save 3D volumes in these formats (including multiframe tiff). They don’t retain that information.