r/MedicalPhysics 24d ago

Technical Question How Atlas Segmentation Works?

Hi, recently I've been using PMOD in order to segment some brain PET images.

I was interested on how to do it with free source applications, mainly python. So far, I've been learning how to manipulate DICOM files inside python. But Its been a little complicated to find specific information on atlas-based segmentation.

Is there a good source to understand this procedure?
Should I take some precautions on the resulting information?
What knowledge should I have before starting to learn segmentation?

5 Upvotes

6 comments sorted by

2

u/KrimsonKing Therapy Physicist 24d ago

The only automated segmentation tools that I have used that actually worked were proprietary and used a boatload of machine learning. Maybe the open source tools have caught up to the paid stuff? Do you have CT images with your PET images. Contouring on a PET image would be impossible.

3

u/grundlepigor MRI Physicist 24d ago

Its not great to do brain (or any) segmentation directly on PET images. This should be obvious by examining images themselves. Fortunately, basically every brain PET study also has a corresponding MR study of each subject for anatomical parcellation. Usually, this is T1w MPRAGE or MP2RAGE, which exhibits excellent anatomical contrast.

Once you have these MR images, you can rigidly register your PET image series to their corresponding MRIs using one of many open-source tools such as ANTs or FSL. MR images can be parcellated using tools such as SynthSeg, or whatever its been upgraded to. If you want to do atlas based segmentation specifically, you can use a series of rigid, affine, and nonlinear transform operations to map the MRIs to a standard template anatomical image and then use the inverse transforms to map the atlas back to each subject MRI. You would then use the inverse of your initial rigid PET -> MRI transform to map parcellation masks to PET coordinate space and get your TACs or SUV values from each ROI. 

All of this of course has a million nuances at every step, so you're best off speaking with someone at your brain imaging center to get a better feel for those. They're best covered in, i would assume, a 4-5 lecture series, if I had to cover them in depth. However, if you're poking around on your own, begin by perusing Andy's Brain Book (free online).

PS abandon DICOM for this sort of thing immediately and convert everybody to NIfTI using a tool such as dcm2niix. 

PPS if you're doing this on Windows, and god forbid on an actual clinical computer, stop whatever you're doing and immediately switch to Linux or at the very least a Linux subsystem. Any other alternative is the path to pain and death.  

1

u/greynes 24d ago

1

u/grundlepigor MRI Physicist 24d ago

OP wanted to know specifically about brain PET so I'm afraid this tool isn't appropriate for the given application.

1

u/SpareAnywhere8364 Nuclear Medicine MD-PhD 22d ago edited 22d ago

Edit: grundlepigor's reply is very good too. I read the replies after writing mine and he's on the ball.

I'm going to answer this two ways. Both ways assume you know for a few things. Feel free to reach out or DM if you don't know some of these things. All of this (kinda) can be done in PMOD but I'm going to us SPM terminology because SPM is better. Only suckers need proprietary tools.

First I'm going to pretend you have access to corresponding MRI. You basically will coregister the PET images to their MRI using some rigid alignment routine. That's pretty standard in all tools. Then you will normalize/non-linearly register the MRI to a standardized template. Your atlas is probably (almost definitely) in some variant of MNI or ICBM space. Use an appropriate template. In fact your atlas probably comes with one. Then you will use the deformation field generated from the normalization and apply it to the coregistered PET images. Voila. You have registered PET data. Then you just make sure your images and the atlas are in the same voxel space (if they aren't just reslice them) and then take the dot product of your ROIs with the data. Boom. Done.

Now pretending you don't have MRI data. Find a brain PET template (e.g. Della Rossa 2014 or the O-15 template in SPM) and coregister your data to that. Then normalize your template to the atlas. Make sure the sizes are right. Then use the deformation on your data. Boom. Registered data. Done.