External Email - Use Caution        

Thank you very much, but I want to implement tf.train.F Feature of python
or numpy data type. This is an essential step towards building any
TFRecords database.

The method I found requires nii files to be extracted and read by SimpleITK

‫في الأربعاء، 23 فبراير 2022 في 6:59 ص تمت كتابة ما يلي بواسطة ‪Fischl,
Bruce‬‏ <‪bfis...@mgh.harvard.edu‬‏>:‬

> Oops, slight edit
>
>
>
> import nibabel as nib
>
>
>
> file_list = [os.path.join(os.getenv(‘SUBJECTS_DIR’), subject, ‘mri’,
> ‘brainmask.mgz’)for subject in subject_list]
>
> mri_list = [nib.load(fname) for fname in file_list]
>
>
> On Feb 22, 2022, at 9:53 PM, Fischl, Bruce <bfis...@mgh.harvard.edu>
> wrote:
>
> 
>
> In python you should be able to do (assuming you have a  list of subject
> ids in subject_list):
>
>
>
> import nibabel as nib
>
>
>
> file_list = [os.path.join(os.getenv(‘SUBJECTS_DIR’), subject) for subject
> in subject_list]
>
> mri_list = [nib.load(fname) for fname in file_list]
>
>
>
> even for 1000 subjects it won’t take that long, depending of course on
> your disk speed. You shouldn’t have to convert from .mgz – nibabel can read
> it
>
>
>
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
> freesurfer-boun...@nmr.mgh.harvard.edu> *On Behalf Of *REEM ABU BAKR
> BAHATHIQ
> *Sent:* Tuesday, February 22, 2022 9:28 PM
> *To:* freesurfer@nmr.mgh.harvard.edu
> *Subject:* [Freesurfer] convert .mgz to .nii
>
>
>
> *        External Email - Use Caution        *
>
> Hello FreeSurfer experts,
>
>
> I want to run a classification task using deep learning on data processed by 
> Freesurfer recon-all and I have some queries. I will use brainmask .mgz
>
>   First of all, based on my simple knowledge, I cannot feed my model with 
> this output directly. .mgz files must be converted to a .nii file for use in 
> analytics. I found that this is done by writing
> mri_convert any_volume.mgz any_volume.nii.gz
>
> But how can I convert the files of all participants (more than 1000) into 
> .nii files instead of going one by one?
>
>
> Are there any examples or tutorials provided to demonstrate the use of 
> Freesurfer output in machine learning applications?
>
> My greetings,
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1d4v_JiLdgyoo1M50Rzz876te5ChiMw78p3ca1kSmYBar4K1UQpEq0Sufgu2nv873YD7i769zX2W_EtXuu5ZbPo18I7MCFdab2nHNavS40ikI56Juu-WqlT93WCw6mp7k5EBk4u2VqQfZiverUh3AGnYTeTESIgdUp8BNwQdHAsGAcfawsvQ3ISZp4Dnf0x2n5VUXeShiWe15oVL6IrkGjCK8BYcSNpXvDvZ94DInDvnDVLa7Z24qRpIVGJywyK0WP0s0kYIFFcpzWa5eKU_LQi_-xmlZqNUcvgM9s3G6eKJyDTjA9t72b02lVdVh4uoq-SeJok_13zPCHWyaIRbCPA/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Reply via email to