ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
633 stars 162 forks source link

Template building with segmented images #307

Closed codeenthusiast closed 2 years ago

codeenthusiast commented 2 years ago

I have build a template registering several CT's together using build_template script from ANTs. Works great! I now want to do two things: 1) register multiple CT's that have different anatomical regions segmented with the template demonstrating the overall average as well as the segmented section 2) I want to use a segmented template where I feed an unsegmented non-registered CT to have it segmented.

Are scripts available for this?

gdevenyi commented 2 years ago

1.Generate the template with all the images.

  1. Resample the segmentations from the images with them using the template transforms.
  2. Vote/merge the segmentations in template space.
  3. Back transform the consensus segmentations onto the unlabelled images
codeenthusiast commented 2 years ago

For step 1, this is generating a template from the segmented images? or the unsegmented images? I'm not sure how to go about steps 2-4, are there possible functions/scripts I can be directed to for this? This is more challenging as I'm from a clinical background and very novice into coding. Thanks again.

gdevenyi commented 2 years ago

For 1 it is all.

2 and 4 and antsApplyTransforms.

I'm not sure antspy has the merging functions. I use the command line exclusively.

stnava commented 2 years ago

there is jointLabelFusion in antspy

brian

On Fri, Oct 29, 2021 at 7:11 PM Gabriel A. Devenyi @.***> wrote:

For 1 it is all.

2 and 4 and antsApplyTransforms.

I'm not sure antspy has the merging functions. I use the command line exclusively.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsPy/issues/307#issuecomment-955095160, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPE7UIHFZROCZ4ASWIEL3UJMS2LANCNFSM5HAEJXDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

codeenthusiast commented 2 years ago

Thank you, I've been able to propagate the segmentation from a template image to my target image.

I have a question regarding my template construction. I am currently using the build_template script which works well with registering unsegmented images.

If I want to create a template image which includes the average segmentation, should I run the build_template script twice? i.e. once for the unsegmented scans and the second run for the segmentations themselves.

gdevenyi commented 2 years ago

i.e. once for the unsegmented scans and the second run for the segmentations themselves.

No, apply the transforms to the segmentations, and merge (majorityvote, JLF, average) the segmentations in the template space.