External Email - Use Caution
I'm trying to determine the smallest rectangular prism that a brain will fit in based on its MRI scan. My strategy is as follows: I am moving through the brain axially, sagittally, and coronally to see where the brain "starts" appearing and "stops" appearing. Then, I'm subtracting the amount of no-brain slices from the total number of slices and multiplying the result by the slice thickness.
This should get me the length (sagittal plane), width (coronal plane), and height (axial plane) of a box that contains the brain.
Is there a function within FreeSurfer that can automate this process of determining "first and last sight of brain" ? It is quite time consuming to manually check hundreds of patients!
Best, Hebah
Hi Hebah,
Interesting application. You could try running mri_synthstrip then analyse the resulting binary mask to determine the first and last slices in each direction.
-Paul
________________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Hebah Tanveer hebah.tanveer@biotexmedical.com Sent: Monday, June 17, 2024 5:18 PM To: freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Brain in a Box
External Email - Use Caution
I'm trying to determine the smallest rectangular prism that a brain will fit in based on its MRI scan. My strategy is as follows: I am moving through the brain axially, sagittally, and coronally to see where the brain "starts" appearing and "stops" appearing. Then, I'm subtracting the amount of no-brain slices from the total number of slices and multiplying the result by the slice thickness.
This should get me the length (sagittal plane), width (coronal plane), and height (axial plane) of a box that contains the brain.
Is there a function within FreeSurfer that can automate this process of determining "first and last sight of brain" ? It is quite time consuming to manually check hundreds of patients!
Best, Hebah
I'm wondering if the bbox() implementation in Surfa (https://github.com/freesurfer/surfa/tree/master) will achieve the task?
surfa.image.framed.bbox() (https://github.com/freesurfer/surfa/blob/master/surfa/image/framed.py#L203) computes the bounding box of the image data greater than zero.
I tried it on bert orig.mgz,
import surfa as sf bert='/usr/local/freesurfer/dev/subjects/bert/mri/orig.mgz' vol=sf.load_volume(bert) vol
sf.Volume(shape=(256, 256, 256), dtype=uint8)
vol.shape
(256, 256, 256)
bbox=vol.bbox() bbox
(slice(47, 207, None), slice(3, 255, None), slice(3, 252, None))
Yujing
-----Original Message----- From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Wighton, Paul Sent: Monday, June 17, 2024 5:34 PM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Brain in a Box
Hi Hebah,
Interesting application. You could try running mri_synthstrip then analyse the resulting binary mask to determine the first and last slices in each direction.
-Paul
________________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Hebah Tanveer hebah.tanveer@biotexmedical.com Sent: Monday, June 17, 2024 5:18 PM To: freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Brain in a Box
External Email - Use Caution
I'm trying to determine the smallest rectangular prism that a brain will fit in based on its MRI scan. My strategy is as follows: I am moving through the brain axially, sagittally, and coronally to see where the brain "starts" appearing and "stops" appearing. Then, I'm subtracting the amount of no-brain slices from the total number of slices and multiplying the result by the slice thickness.
This should get me the length (sagittal plane), width (coronal plane), and height (axial plane) of a box that contains the brain.
Is there a function within FreeSurfer that can automate this process of determining "first and last sight of brain" ? It is quite time consuming to manually check hundreds of patients!
Best, Hebah
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu