[Neuroimaging] select all voxels in one hemisphere

Sam W samfmri at gmail.com
Thu Nov 21 13:52:07 EST 2019


Hi Amit!

Thanks for your suggestions. I just need to assign a number to all left
hemisphere voxels (and leave right hemisphere voxels unchanged), so using
freesurfer for this purpose might really be an overkill. I was hoping I
could get away with combining numpy with nilearn/nibabel, is this not
feasible?

Best regards,
Sam

On Wed, Nov 20, 2019 at 11:41 PM Amit Akula <amitvakula at gmail.com> wrote:

> Hi Sam!
>
> Hope you are doing well.
>
> There are many segmentation algorithms that can be used to do this in a
> more robust approach.
>
> The Roland Henry Laboratory at UCSF (where I work) generally uses
> Freesurfer's recon_all
> <https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all> pipeline. It can be
> used go generate a brain mask and further pipelines
> <http://narr.bmap.ucla.edu/protocols/data_processing_archives/convert_freesurfer_outputs_and_calculate_dist_q/> can
> be use to generate hemisphere masks. It may be a bit overkill for your work
> as it does much more subcortical segmentations.
>
> There is also a way to manually segment/correct ROIs using nilearn if you
> want to manually do more sophisticated segmentations/corrections. Here
> <https://nilearn.github.io/auto_examples/04_manipulating_images/plot_roi_extraction.html> is
> a starting guide on that using nilearn.
>
> Let me know if you want to take this offline and I can walk you through it.
>
> Sincerely,
> Amit
>
> p.s. I can look into and send you more stuff like hemisplit
> <https://nipype.readthedocs.io/en/0.12.1/interfaces/generated/nipype.interfaces.brainsuite.brainsuite.html#hemisplit>,
> etc. if you would like a more focused tool other than recon_all. Lemme know!
>
> On Wed, Nov 20, 2019 at 2:25 PM Sam W <samfmri at gmail.com> wrote:
>
>> Hello!
>> I've been trying unsuccessfully to select all voxels in one hemisphere
>> using nilearn/nibabel
>> I tried selecting all voxels that are to the left of the center of the
>> image, something along these lines:
>>
>> im = load_img('my_im.nii')
>> mid = int(np.ceil(im.shape[0]/2)) #centre of image
>> data = im.get_data()
>> data[mid:,:,:] #this should select the left side of image
>>
>> This wont work however because mid might not be exactly the middle of the
>> brain...
>> Is there a better way to do this?
>> Thanks!
>> Sam
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20191121/51b42a99/attachment.html>


More information about the Neuroimaging mailing list