How to stitch together two sets of CT slices to make one file

Operating system: Mac OS X 10.10
Slicer version: 4.6.2
Expected behavior: I import a folder with 421 DICOM slices that should show all of the cranium and mandible of an individual
Actual behavior: The program says that 421 slices have been successfully loaded, when the files of the individual are loaded, the upper part of the cranium is cut out, so it doesn’t show.

Is there a limit of images that can be loaded? How should I solve this problem?? Thank you very much in advance

Do you know if the DICOM series has a uniform slice thickness? The symptom you mention has occurred with datasets with non-uniform slice thickness.

In any case, please try it out again with the latest nightly, 4.6.2 is almost a year old now. Thanks!

Thank you very much, I’ve downloaded the newest version of the program and now I realised that the problem is that each individual is comprised of two series of CT scans, I have been looking for an explanation or a tutorial on how to stitch these two sets together but so far I haven’t found anything. Is it possible to do it with Slicer??

EDIT: I’m going to change the name of the topic to make it more accurate

Thanks for the update, it seems we are making progress! Also thanks for changing the title.

Stitching the volumes is possible, but it won’t be trivial. I imagine the major steps will be these:

  1. Make sure the two volumes align. If showing them together (set one as background, the other as foreground with 50% opacity) shows overlap, or the two parts are otherwise do not align, then a transform needs to be created to make them align perfectly (create linear transform in Transforms module, set it to one of the volumes, and tweak the transform until alignment is reached)
  2. Resample the volumes to a common frame of reference. Need to create an empty volume that spans both images, ideally in a way that the voxels do not need to be interpolated. I’d try to do this with the Crop Volume module, but I’m not sure that a ROI larger than the cropped image is handled. Then both volumes need to be resampled to this common frame of reference with Resample Image (BRAINS).
  3. Add the two volumes together with Add Scalar Volumes

The exact details of these steps will need to be figured out. Let us know how it goes.

First of all, thank you again! The thing is that when I load the folder with all of the images Slicer just recognises one patient, and it’s always the same part of the CT scan. I realised the folder contained two different scans because I tried opening the folder in Mimics 10.1, which “made me” choose to load one of the sets.
I’m sorry for all of the trouble, I’m fairly new to using Slicer so I’m still getting used to it

No worries! Let us know if you have further quetsions.

If multiple series are stored in a folder or files of a series is spread across multiple folders then you need to use the DICOM module to import it. It will show you a similar patient/study/series selector as Mimics.

Thank you very much for your answer.
The problem is that it just recognises one patient and shows just one of the halves, whereas Mimics recognises two different sets. I’m still trying to open both halves at the same time to try to stitch both parts together.

To see both sets, you need to import the folder into Slicer (drag-and-drop the folder and choose to import as DICOM), then load it using the DICOM browser. See details here:

What about if there is a large region of overlap? How can I get either the average, max, or some kind of boolean, i.e. pick volume A over B except where A = -1024

You can get images as numpy arrays, so you can very easily combine them in any way you want using numpy operations.

Just a few illustrative examples (I haven’t tested these expressions, so syntax may not be fully correct, but something similar should work):

Get minimum of two images: imageCombined = numpy.minimum(imageA,imageB)

Get image A voxels if it is above a certain intensity threshold, otherwise return the mean of image A and B: imageCombined = numpy.where(imageA>1500, imageA, (imageA+imageB)/2.0)

I am trying to piece together multiple VTK files. When I go to add scalar volumes, its says completes with errors.

You have to follow the instructions above. Most importantly: resample the volumes using the same reference volume (to make them have the same origin, spacing, axis directions, and extent).

When performing BRAINSresample it is saying completed with error and indicates that it was only performed with 1.

Do you use the latest stable version (Slicer-4.8.1)? Can you attach a screenshot of the BRAINSresample module user interface to see how you set your inputs and outputs?

Just in case somebody comes across this topic now: @mikebind recently contributed the Stitch Volumes module for stitching multiple volumes into one. It is available in Sandbox extension.

1 Like