Re: [Freesurfer] Recon-all failing with pre-skullstripped input data (mri_em_register can't find brainmask.mgz)

2023-12-29 Thread James Hengenius
External Email - Use Caution

Thanks for pointing that out! That seems to be working. Jim

On Thu, Dec 28, 2023 at 6:53 PM Huang, Yujing 
wrote:

> This is from Freesurfer wiki -
> https://secure-web.cisco.com/1CkNjrY48pCUahVqRgpWm_wWr-VT402BvZ0Y61vf5NBHE08gelDHJOnnrnONbPXLIsRUSgn-e1KlQ28-1bqlh2D9mdfR4oz5K2DcAapaDi_kIRYa9oOGpUGPN7HBgvT7nsrqBOhDSS1cOpeZ1vlmzNwZczc-cKlN2aymuKdjRBszVXj6pSIzy284SpTKycNB0Fu9kYvlF9WMrQLPBazYr7itkxhkOU3JWMD4-UoiVa9TbyhR71UonTZDQK57ox2IABmOi_Byg-ahMf7rWMa3NdavabkZhRt_6s9jZZE9ooyzXY-aFh0m-UBLCJJ5H-q_XO5-sie0nuzq8b8Z2HV6a3Q/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FUserContributions%2FFAQ
>
> *Q. I have already skull-stripped data. Can I submit it to recon-all?*
>
> A: If your skull-stripped volume does not have the cerebellum, then no. If
> it does, then yes, however you will have to run the data a bit differently.
>
> First you must run only -autorecon1 like this:
> *recon-all -autorecon1 -noskullstrip -s *
>
> Then you will have to make a symbolic link or copy T1.mgz to
> brainmask.auto.mgz and a link from brainmask.auto.mgz to brainmask.mgz.
> Finally, open this brainmask.mgz file and check that it looks okay (there
> is no skull, cerebellum is intact; use the sample subject *bert* that
> comes with your FreeSurfer installation to make sure it looks comparable).
> From there you can run the final stages of recon-all:
> *recon-all -autrecon2 -autorecon3 -s *
>
> Hope it helps.
>
>
>
> Best,
>
>
>
> Yujing
>
>
>
> *From:* freesurfer-boun...@nmr.mgh.harvard.edu <
> freesurfer-boun...@nmr.mgh.harvard.edu> *On Behalf Of *James Hengenius
> *Sent:* Thursday, December 28, 2023 5:06 PM
> *To:* Freesurfer support list 
> *Subject:* [Freesurfer] Recon-all failing with pre-skullstripped input
> data (mri_em_register can't find brainmask.mgz)
>
>
>
> *External Email - Use Caution*
>
> Hello FS experts,
>
>
>
> I downloaded some anatomical data. I have defaced full images and
> pre-skullstripped images for each participant. I tried the defaced images
> first, but FS skullstripping looks a little off (possibly because the
> defacing hides bits of the cranium in some images and causes problems in
> mri_watershed). So I would like to use the pre-skullstripped files as my
> initial inputs.
>
>
>
> I have placed the pre-skullstripped file for each participant in
> $SUBJECTS_DIR/$subjid/mri/orig/. Each participant's skullstripped input
> volume is named 001.mgz.
>
>
>
> I then submit the following command in a script to my slurm queue (after
> setting appropriate FS env vars), where the script input ${1} is the
> $subjid mentioned above:
>
>
>
> recon-all \
> -subject ${1} \
> -all \
> -openmp 40 \
> -noskullstrip
>
>
>
> The output log from FS ends with the following error. The
> function mri_em_register seems to be looking for brainmask.mgz, and fails
> to open it. If the input image is already extracted from the skull, do I
> need to manually call it brainmask.mgz rather than 001.mgz? Or am I missing
> something else in my function call (like order of flags)? Does
> -noskullstrip need to come before -openmp, for example?
>
>
>
> Thanks!
>
> Jim H.
>
>
>
> End of recon-all output:
>
>
>
> writing output to T1.mgz
> 3D bias adjustment took 1 minutes and 20 seconds.
> @#@FSTIME  2023:12:28:16:07:04 mri_normalize N 7 e 80.39 S 0.66 U 102.70 P
> 128% M 581068 F 0 R 24411 W 0 c 32 w 229 I 0 O 0 L 1.00 1.38 9.22
> @#@FSLOADPOST 2023:12:28:16:08:25 mri_normalize N 7 1.99 1.66 8.64
> #-
> #@# EM Registration Thu Dec 28 16:08:25 EST 2023
> /gpfs/fs0/scratch/t/tpaus/jhengeni/subjects_dir_ukb/1000108_20252_2_0/mri
>
>
>  mri_em_register -uns 3 -mask brainmask.mgz nu.mgz
> /home/t/tpaus/jhengeni/fs_versions/7.4.1/freesurfer/average/RB_all_2020-01-02.gca
> transforms/talairach.lta
>
>
> setting unknown_nbr_spacing = 3
> using MR volume brainmask.mgz to mask input volume...
>
>
> == Number of threads available to mri_em_register for OpenMP = 40 ==
> reading 1 input volumes...
> logging results to talairach.log
> reading
> '/home/t/tpaus/jhengeni/fs_versions/7.4.1/freesurfer/average/RB_all_2020-01-02.gca'...
> GCAread took 0 minutes and 1 seconds.
> average std = 7.2   using min determinant for regularization = 5.2
> 0 singular and 884 ill-conditioned covariance matrices regularized
> reading 'nu.mgz'...
> error:
>
> *mghRead(/gpfs/fs0/scratch/t/tpaus/jhengeni/subjects_dir_ukb/1000108_20252_2_0/mri/brainmask.mgz,
> -1): could not open file^@ error: mri_em_register: could not open mask
> volume brainmask.mgz. ^@*
> @#@FSTIME  2023:12:28

[Freesurfer] Recon-all failing with pre-skullstripped input data (mri_em_register can't find brainmask.mgz)

2023-12-28 Thread James Hengenius
External Email - Use Caution

Hello FS experts,

I downloaded some anatomical data. I have defaced full images and
pre-skullstripped images for each participant. I tried the defaced images
first, but FS skullstripping looks a little off (possibly because the
defacing hides bits of the cranium in some images and causes problems in
mri_watershed). So I would like to use the pre-skullstripped files as my
initial inputs.

I have placed the pre-skullstripped file for each participant in
$SUBJECTS_DIR/$subjid/mri/orig/. Each participant's skullstripped input
volume is named 001.mgz.

I then submit the following command in a script to my slurm queue (after
setting appropriate FS env vars), where the script input ${1} is the
$subjid mentioned above:

recon-all \
-subject ${1} \
-all \
-openmp 40 \
-noskullstrip

The output log from FS ends with the following error. The
function mri_em_register seems to be looking for brainmask.mgz, and fails
to open it. If the input image is already extracted from the skull, do I
need to manually call it brainmask.mgz rather than 001.mgz? Or am I missing
something else in my function call (like order of flags)? Does
-noskullstrip need to come before -openmp, for example?

Thanks!
Jim H.

End of recon-all output:

writing output to T1.mgz
> 3D bias adjustment took 1 minutes and 20 seconds.
> @#@FSTIME  2023:12:28:16:07:04 mri_normalize N 7 e 80.39 S 0.66 U 102.70 P
> 128% M 581068 F 0 R 24411 W 0 c 32 w 229 I 0 O 0 L 1.00 1.38 9.22
> @#@FSLOADPOST 2023:12:28:16:08:25 mri_normalize N 7 1.99 1.66 8.64
> #-
> #@# EM Registration Thu Dec 28 16:08:25 EST 2023
> /gpfs/fs0/scratch/t/tpaus/jhengeni/subjects_dir_ukb/1000108_20252_2_0/mri


>  mri_em_register -uns 3 -mask brainmask.mgz nu.mgz
> /home/t/tpaus/jhengeni/fs_versions/7.4.1/freesurfer/average/RB_all_2020-01-02.gca
> transforms/talairach.lta


> setting unknown_nbr_spacing = 3
> using MR volume brainmask.mgz to mask input volume...


> == Number of threads available to mri_em_register for OpenMP = 40 ==
> reading 1 input volumes...
> logging results to talairach.log
> reading
> '/home/t/tpaus/jhengeni/fs_versions/7.4.1/freesurfer/average/RB_all_2020-01-02.gca'...
> GCAread took 0 minutes and 1 seconds.
> average std = 7.2   using min determinant for regularization = 5.2
> 0 singular and 884 ill-conditioned covariance matrices regularized
> reading 'nu.mgz'...
> error:
>
> *mghRead(/gpfs/fs0/scratch/t/tpaus/jhengeni/subjects_dir_ukb/1000108_20252_2_0/mri/brainmask.mgz,
> -1): could not open file^@error: mri_em_register: could not open mask
> volume brainmask.mgz.^@*
> @#@FSTIME  2023:12:28:16:08:25 mri_em_register N 7 e 1.42 S 0.25 U 1.43 P
> 118% M 446804 F 0 R 108260 W 0 c 2 w 56 I 0 O 0 L 1.99 1.66 8.64
> @#@FSLOADPOST 2023:12:28:16:08:26 mri_em_register N 7 1.99 1.66 8.64
> Linux nia0918.scinet.local 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17
> 15:42:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux


> recon-all -s 1000108_20252_2_0 exited with ERRORS at Thu Dec 28 16:08:26
> EST 2023


> For more details, see the log file
> /gpfs/fs0/scratch/t/tpaus/jhengeni/subjects_dir_ukb/1000108_20252_2_0/scripts/recon-all.log
> To report a problem, see
> http://secure-web.cisco.com/1ywN1tDbl7MCg8OnWFYEA2Vcf-TaEWXJQlDYsrE7jJo4KqFgIlOWrzhzxDJm5uF11tgXR5fJi2W6vOuAdAAji5cdTjFimLnIGxtWSTB2-y5_HnBRRIRECgA43AhrDctzKRH546l4MaMTjVU30ZQUb5Jk54LqnNfWrh1gB0jsLHkHSgZBFmAXPrV3SIvbWFicYVt_Ebi8mCF-_Gi9xARjm2WPsG0bGNjIIC4gKMbRxQt_nSp83Y3Ik-tj4yEHQqrbfZSKxciUlXvG9xnPomANL8b4bFKfyM3zWmptSyMDvRAsv1F_SGfc8x8zU56LlZL2aPPLp5h3_wxXguFcFo2wxOQ/http%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2FBugReporting
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Re: [Freesurfer] 3D printing from freesurfer

2023-08-15 Thread James Hengenius
External Email - Use Caution

You can print from the surfaces. Using

mris_convert --combinesurfs $SUBJECTS_DIR/${subject}/surf/lh.pial
$SUBJECTS_DIR/${subject}/surf/rh.pial \
 $SUBJECTS_DIR/cortical.stl

will take the pial surfaces from both hemispheres and combine them into a
single STL file compatible with many printers. To go from a volumetric file
like aparc or aseg, you'd need to binarize your volume and use mri_tessellate
to make a surface mesh around it and mris_convert to make an STL from the
mesh, but that's just extra steps when you have the surface outputs from FS
already.

Either way, you may need to do some post-processing in a CAD program to
make the resulting mesh more printer-friendly. If you want to include
cerebellum and brainstem as well, you will need to 1) extract and binarize
the ROIs, 2) use mri_tessellate to get surfaces and mris_convert to get STL
format, and 3) merge the cortical STL with the cerebellar/brainstem STL.

Michael Notter has a nice set of scripts (using FSL for cerebellum and
brainstem rather than FS) that walk you through putting together the final
whole-brain STL file for printing:
https://secure-web.cisco.com/1BvbhU8GaBWBicxBZZUAUX-wSoz7hnR2gLOFIO_YUkei8jz6RJQsMHCdVVNfGrjWq8FWHIJ14y5v1pXsFzVCspLs4o70R9PKF8slfxLRF8QqdDh5uaxc346SJ0US76D_VdSucvaxmqyVe0Wxd2GyjUD_t3zvUrrhFvF2zvoYA4khjPAZbO5CnLkL2OIQdwwpVVVGyyBlcBXO5_AD1jZ-MkY_o2ZykiKGIfJWspoyh0paV4WaaM7dFj7WDUmxgt6_ED37dPGCFc53XWPt9F_0rK_PgM3GMJf1e1b91RanLrj5ODQZh96UlWy1U2XHeMRm-caRJPwwNluT-0F9HvYJdqA/https%3A%2F%2Fgithub.com%2Fmiykael%2F3dprintyourbrain



On Tue, Aug 15, 2023 at 8:24 AM Pukovisa Prawiroharjo 
wrote:

> External Email - Use Caution
>
> can we print the aseg and aparc image in fresurfer to 3D model for print
> it in 3D printer?
>
> best regards
>
> *Pukovisa Prawiroharjo, M.D., Sp.N, Subsp. NGD (K), PhD*
> Neurobehavior Consultant, Neurology Specialist
> Neurology Department, Faculty of Medicine, Universitas Indonesia
> Chair of Bioethics Cluster IMERI UI
> Chair of International Policy Div, Board of Development Med Services IDI
>
>
> 
>  Bebas
> virus.*MailScanner has detected a possible fraud attempt from
> "secure-web.cisco.com" claiming to be* 
> http://secure-web.cisco.com/173cX-SXtFZ4KwmB9mFxyHBlZrBAcjnlkMifzSpKsCvV8O5hNTJHQWCPTxw6gci14rFW8cFfsctAuy9E6XBEryUzyzxPAeGb6isaVq33RMvyPZtuAY0YTA3XVwKLD-S1OYzzCTU4ZYTr5FaSk1gdVzq00cUxa-f1Khgy_j233LcZ_H5YqGD315_iraBiaNfpijyoJt7sssL_Op88_b14mmylQ4qV6LOvSftY_D_SFfp3wVHRBt25BN7yjmb_QWVX08QM9uNQGtKYlY8tFAokJvXw6WKWCSBEA-kPElHOQsZIUvldVakbjst5f1mYl1wFxTl8Jqh4COaqomf-J9t1L_w/http%3A%2F%2Fwww.avast.com
> 
> <#m_6148274990827441277_m_-931960845474204543_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1OOQMokOn9C1PgGLkDP9KitVFX7PjSHM47msneRVwFxDARedZebGUfvZnkq1kMvtPMn00a0OoGyYpcqLdRyqvno4pDGjoNNF5mHt8M4dw5pO6Wu5gx6uYMv19Ml8IRAB6zrh5XE6HjiJ6DPR4l_MlI9zoBtlp6KbpyMZRMVssIRNwt3CC9lt31qAFivZAuohmQdEDKhhY1KorskFLqE6zryazCeINkmqPH5af7iGr95JHp8dolGgZa-DkGZ2HGagQ6v49Wb0F6I6_-MjePiG50u5JaYq1b5ICM7Y10RIAwViD_uN5spRFMyzJLuXXXvCjQDWPE5oAcAZ78YwQYsk3Rg/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer



-- 
Jim Hengenius
Research Associate
Paus Research Group
CHU Sainte-Justine Research Centre
My Google Calendar

___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu

[Freesurfer] Post-doctoral position at University of Pittsburgh in population neuroscience

2022-08-03 Thread James Hengenius
External Email - Use Caution

*Dear All, please see the opportunity for a Post-Doctoral Associate
position:*



*Link to apply*: Job Description - Post Doctoral Associate (ROSANO)
(21008433) (taleo.net)


https://secure-web.cisco.com/1ZOanogXZkLzkQnqrC_mxzi3jWIx4w7dKQBsNZA5Sfk_8PR6qgOJN1XCVC6zGz0ApudW2om-d8nB2h6koYhw-aiZLferhAa1W7EuFhbwQtavpveNckdyWYzoGcW3RoD6z730ecSTWoGHRlEFX08tM4NWuzrlQn3_jaJPZmlRxEwMk1ckRY-FvBPOMM_dbpqTLkUD8UK487rjGMXz38cEr3Lqj3MYSxp3l0iQU2Pk2h7NfwFJ76NuDh3U0yZ26RHjwnY_vAh-fBlmxhxiFIJ2_WZVeNWj74JKvYGdszvB6_9HMnFn0uThxiOQ158mEp77IsBpSOKKs31Af_tzWbeGL8mgK5Oi0iv9Rm090-IEV6Gw/https%3A%2F%2Fcfopitt.taleo.net%2Fcareersection%2Fpitt_faculty_external_pd%2Fjobsearch.ftl%3Flang%3Den%26portal%3D24100023232


position # 21008433



*Post-Doctoral Associate* (with Dr. Caterina Rosano)

GSPH-Epidemiology - Pennsylvania-Pittsburgh - (21008433)

Post-Doctoral Associate; Graduate School of Public Health (GSPH),
Department of Epidemiology


The Postdoctoral Associate will join a cross-institutional research team
focused on the intersection of epidemiology, neuroscience, neuroimaging,
causal inference, and machine learning. The Postdoctoral Associate is
expected to take a leadership role in ongoing research projects, including
developing novel and important research questions, analyzing data, writing
manuscripts, and meeting with mentors. The candidate will be encouraged to
develop their own personal goals within the context of the existing
research program, and will work with mentors to achieve these goals.



*Duties and responsibilities*: All activities below will be performed
independently and then reviewed by the mentors for discussion and revisions.



-Develop short-term (6 months) and longer-term (1-2 years) career goals.

-Develop important and novel research questions within the context of the
research program.

-Analyze neuroimaging and epidemiological data

-Interpret results.

-Write manuscripts based on research findings.

-Provide some mentorship to Ph.D. students and contribute to their
manuscripts as appropriate.



*Expectations: *The Postdoctoral Associate will have a Ph.D. in
epidemiology, biostatistics, neuroscience, or another area of public
health. They will also have experience in causal inference and/or machine
learning. The Postdoctoral Associate is expected to produce 3 to 4
first-authored papers per year and co-author manuscripts that come out of
the research group, as appropriate, as well as submit one or more abstracts
to scientific meetings each year. They will attend weekly mentorship
meetings and biweekly research team meetings, and provide input on other
work coming out of the research group.



*Opportunities:* Attendance of several annual meetings, including the
society of neuroscience, Human Brain Mapping, Gerontological Society of
America.



Presentation of results in those scientific meetings, to the Epidemiology
Department, to visiting experts, and to our research team;



Participation in career development 

Re: [Freesurfer] resample_type ignored by mri_convert with --like argument?

2022-05-13 Thread James Hengenius
External Email - Use Caution

Thanks,  that worked without error and the resampling looks correct.

Jim

On Thu, May 12, 2022, 11:42 PM Douglas N. Greve 
wrote:

> Sorry, one more thing. Add --regheader to the command lien
>
> On 5/12/2022 5:12 PM, James Hengenius wrote:
>
> External Email - Use Caution
> Hi Douglas,
>
> Thanks for the suggestion! However, using mri_vol2vol generates the error
> message:
>
> ERROR: SUBJECTS_DIR undefined.
>>
>
> If I set SUBJECTS_DIR  to the study directory, I get the following error:
>
> movvol ICBM152_2009c_AtlasWhite.nii.gz
>> targvol  T1w_MNI.nii.gz
>> outvol AtlasWhite_resampled.nii.gz
>> invert 0
>> tal0
>> talres 2
>> regheader 0
>> noresample 0
>> interp  nearest (0)
>> precision  float (3)
>> Gdiag_no  -1
>> Synth  0
>> SynthSeed  1653169738
>> ERROR: no registration (R) is specified
>>
> Invalid argument
>> mri_vol2vol  --targ  T1w_MNI.nii.gz --interp nearest  --mov
>> ICBM152_2009c_AtlasWhite.nii.gz  --o AtlasWhite_resampled.nii.gz : Signal
>> 124
>
>
>  Note that our participant directories aren't in the standard Freesurfer
> subject directory structure, if that matters. Is mri_vol2vol looking for a
> Freesurfer generated registration somewhere in the subject directory?
>
> Thanks!
>
> Jim H
>
> On Thu, May 12, 2022 at 3:43 PM Douglas N. Greve 
> wrote:
>
>> try this
>> mri_vol2vol --targ T1w_MNI.nii.gz  --interp nearest --mov
>> ICBM152_2009c_AtlasWhite.nii.gz   --o WhiteAtlas_resampled.nii.gz
>>
>>
>> On 5/9/2022 11:58 AM, James Hengenius wrote:
>>
>> External Email - Use Caution
>> Hello FS experts,
>>
>> I'm trying to reslice a third-party atlas into the same resolution as my
>> data in MNI space.  I am using the following command:
>>
>> mri_convert
>> --like T1w_MNI.nii.gz
>> --resample_type nearest
>> ICBM152_2009c_AtlasWhite.nii.gz
>> WhiteAtlas_resampled.nii.gz
>>
>> Output is:
>>
>> mri_convert --like T1w_MNI.nii.gz  --resample_type nearest
>> ICBM152_2009c_AtlasWhite.nii.gz WhiteAtlas_resampled.nii.gz
>> reading from ICBM152_2009c_AtlasWhite.nii.gz...
>> TR=0.00, TE=0.00, TI=0.00, flip angle=0.00
>> i_ras = (1, 0, 0)
>> j_ras = (0, 1, 0)
>> k_ras = (0, 0, 1)
>> INFO: transform src into the like-volume: T1w_MNI.nii.gz
>> writing to WhiteAtlas_resampled.nii.gz...
>>
>> In the resulting resampled atlas, the boundaries of the ROIs appear to
>> use an interpolation and not nearest neighbor (i.e., they take values other
>> than the ROI values in the atlas). Not sure if I can embed images - if so,
>> see the attached for an example:
>>
>> [image: image.png]
>>
>> The output is the same whether I include the --resample_type nearest flag
>> or leave it out, making me think that mri_convert is ignoring the flag and
>> using the default interp option.
>>
>> This can be replicated in the relatively current version
>> "freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b" as well as the
>> older "$Id: recon-all,v 1.379.2.73 2013/05/12 23:15:37 nicks Exp $" (which
>> we keep around for old pipeline compatibility).
>>
>> Any ideas on how to fix this so the ROI interfaces take appropriate
>> (nearest neighbor) values rather than interpolated values?
>>
>> Thanks all!
>>
>> Jim H.
>>
>>
>> ___
>> Freesurfer mailing listfreesur...@nmr.mgh.harvard.edu*MailScanner has 
>> detected a possible fraud attempt from "secure-web.cisco.com" claiming to 
>> be* 
>> https://secure-web.cisco.com/1EM4baxR8u3Q8gwbnuY9vttqG6xIZYi2LfAAzIEPwEpbPnahjbQXJ7B92U_Z17PBmB9vK56w1rG89cpVbyf-O5QpFN3aA59Jhr7a3gV2WlICJAf2wQ_gl1m0yKJX-lFXO2loCU5U7CjnO0mkr61YN5BXMkZ-92Hf2BI_0SZFVq-msu45VNA8rdN2HBKN4RXdVT7Ge62oWVdw7Gi6xz7oG_UJxkOaHHBnXTn6X6BeDHeEOatGygHHx9Sov6wjWpYqsQTP2KrJhAtsg0TOSKmrehFSR0vlnkd1JwE7MWjf5Ev58nhYQeQz8begZ9_uyJD3i/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
>>  
>> <https://secure-web.cisco.com/1JIZT_Nfiv_O3V9Op5Rohp18FzwEzNqX9wj3wDmq3BJ0VxUxdjABcebZf1uYIt3Ykm3x4kBqIi_GgPXGGKj7_63Bh8EedMUsbYb9Eez_KBxhNIwuuImuYDR2KRT6ndOzwAh8AqcSf8esLY5ERtCzZl1cbgJmRLv5sT2uBp2GsEb0xwoLEV-jlsKLvNRpU-TYYTsotAtl_bx5qJc1fdZFGvDh7Vyq9adglfuWCEkV3z63Ld7RqTwFphZl6R_hYyUhknkNVzUpiTF7909fdWXaAS4bbBJ2qdJj1CVplEABNHWCaoUIxFVAgTYnO3UFJe53O/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer>
>>
>>
>> ___

Re: [Freesurfer] resample_type ignored by mri_convert with --like argument?

2022-05-12 Thread James Hengenius
External Email - Use Caution

Hi Douglas,

Thanks for the suggestion! However, using mri_vol2vol generates the error
message:

ERROR: SUBJECTS_DIR undefined.
>

If I set SUBJECTS_DIR  to the study directory, I get the following error:

movvol ICBM152_2009c_AtlasWhite.nii.gz
> targvol  T1w_MNI.nii.gz
> outvol AtlasWhite_resampled.nii.gz
> invert 0
> tal0
> talres 2
> regheader 0
> noresample 0
> interp  nearest (0)
> precision  float (3)
> Gdiag_no  -1
> Synth  0
> SynthSeed  1653169738
> ERROR: no registration (R) is specified
>
Invalid argument
> mri_vol2vol  --targ  T1w_MNI.nii.gz --interp nearest  --mov
> ICBM152_2009c_AtlasWhite.nii.gz  --o AtlasWhite_resampled.nii.gz : Signal
> 124


 Note that our participant directories aren't in the standard Freesurfer
subject directory structure, if that matters. Is mri_vol2vol looking for a
Freesurfer generated registration somewhere in the subject directory?

Thanks!

Jim H

On Thu, May 12, 2022 at 3:43 PM Douglas N. Greve 
wrote:

> try this
> mri_vol2vol --targ T1w_MNI.nii.gz  --interp nearest --mov
> ICBM152_2009c_AtlasWhite.nii.gz   --o WhiteAtlas_resampled.nii.gz
>
>
> On 5/9/2022 11:58 AM, James Hengenius wrote:
>
> External Email - Use Caution
> Hello FS experts,
>
> I'm trying to reslice a third-party atlas into the same resolution as my
> data in MNI space.  I am using the following command:
>
> mri_convert
> --like T1w_MNI.nii.gz
> --resample_type nearest
> ICBM152_2009c_AtlasWhite.nii.gz
> WhiteAtlas_resampled.nii.gz
>
> Output is:
>
> mri_convert --like T1w_MNI.nii.gz  --resample_type nearest
> ICBM152_2009c_AtlasWhite.nii.gz WhiteAtlas_resampled.nii.gz
> reading from ICBM152_2009c_AtlasWhite.nii.gz...
> TR=0.00, TE=0.00, TI=0.00, flip angle=0.00
> i_ras = (1, 0, 0)
> j_ras = (0, 1, 0)
> k_ras = (0, 0, 1)
> INFO: transform src into the like-volume: T1w_MNI.nii.gz
> writing to WhiteAtlas_resampled.nii.gz...
>
> In the resulting resampled atlas, the boundaries of the ROIs appear to use
> an interpolation and not nearest neighbor (i.e., they take values other
> than the ROI values in the atlas). Not sure if I can embed images - if so,
> see the attached for an example:
>
> [image: image.png]
>
> The output is the same whether I include the --resample_type nearest flag
> or leave it out, making me think that mri_convert is ignoring the flag and
> using the default interp option.
>
> This can be replicated in the relatively current version
> "freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b" as well as the
> older "$Id: recon-all,v 1.379.2.73 2013/05/12 23:15:37 nicks Exp $" (which
> we keep around for old pipeline compatibility).
>
> Any ideas on how to fix this so the ROI interfaces take appropriate
> (nearest neighbor) values rather than interpolated values?
>
> Thanks all!
>
> Jim H.
>
>
> ___
> Freesurfer mailing 
> listfreesur...@nmr.mgh.harvard.eduhttps://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> ___
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://secure-web.cisco.com/1JIZT_Nfiv_O3V9Op5Rohp18FzwEzNqX9wj3wDmq3BJ0VxUxdjABcebZf1uYIt3Ykm3x4kBqIi_GgPXGGKj7_63Bh8EedMUsbYb9Eez_KBxhNIwuuImuYDR2KRT6ndOzwAh8AqcSf8esLY5ERtCzZl1cbgJmRLv5sT2uBp2GsEb0xwoLEV-jlsKLvNRpU-TYYTsotAtl_bx5qJc1fdZFGvDh7Vyq9adglfuWCEkV3z63Ld7RqTwFphZl6R_hYyUhknkNVzUpiTF7909fdWXaAS4bbBJ2qdJj1CVplEABNHWCaoUIxFVAgTYnO3UFJe53O/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
> The information in this e-mail is intended only for the person to whom it
> is addressed.  If you believe this e-mail was sent to you in error and the
> e-mail contains patient information, please contact the Mass General
> Brigham Compliance HelpLine at
> https://secure-web.cisco.com/1y2kmJO_G-NY507NWtUnosin6IDNpUoIzwBGK1AUPUr47l-NRFXPoEwFm8cx3xl1LT4uNpx-aeidDAIp6p_QX2v1hJHflaZ6ihPkTyW_Ild0nFuUGtDnYl6Yo0joERw9VJl-bukSh9fjc3WFLMRSv4LpEpRbfbR-nI-sV6tjEoCji0ctBvTzdqqQIuyhWCmRl5_cLG3Y4PFgbFmd9Bs0ZGrL6_fGXRgyruCYttTIjk7St_0Igw5CE7m82B4ODQqYuIhiYDHN5c7jUi1bARAUBX9_nrv8qRUjQ1KxOGFyTSlOrcNHZ3ieljHuDB2QGaTO2/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline
>  <
> https://secure-web.cisco.com/1y2kmJO_G-NY507NWtUnosin6IDNpUoIzwBGK1AUPUr47l-NRFXPoEwFm8cx3xl1LT4uNpx-aeidDAIp6p_QX2v1hJHflaZ6ihPkTyW_Ild0nFuUGtDnYl6Yo0joERw9VJl-bukSh9fjc3WFLMRSv4LpEpRbfbR-nI-sV6tjEoCji0ctBvTzdqqQIuyhWCmRl5_cLG3Y4PFgbFmd9Bs0ZGrL6_fGXRgyruCYttTIjk7St_0Igw5CE7m82B4ODQqYuIhiYDHN5c7jUi1bARAUBX9_nrv8qRUjQ1KxOGFyTSlOrcNHZ3ieljHuDB2QGaTO2/https%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline>
>  .
> Please note that this e-mail is not secure (encrypted).  If y

[Freesurfer] resample_type ignored by mri_convert with --like argument?

2022-05-09 Thread James Hengenius
External Email - Use Caution

Hello FS experts,

I'm trying to reslice a third-party atlas into the same resolution as my
data in MNI space.  I am using the following command:

mri_convert
--like T1w_MNI.nii.gz
--resample_type nearest
ICBM152_2009c_AtlasWhite.nii.gz
WhiteAtlas_resampled.nii.gz

Output is:

mri_convert --like T1w_MNI.nii.gz  --resample_type nearest
ICBM152_2009c_AtlasWhite.nii.gz WhiteAtlas_resampled.nii.gz
reading from ICBM152_2009c_AtlasWhite.nii.gz...
TR=0.00, TE=0.00, TI=0.00, flip angle=0.00
i_ras = (1, 0, 0)
j_ras = (0, 1, 0)
k_ras = (0, 0, 1)
INFO: transform src into the like-volume: T1w_MNI.nii.gz
writing to WhiteAtlas_resampled.nii.gz...

In the resulting resampled atlas, the boundaries of the ROIs appear to use
an interpolation and not nearest neighbor (i.e., they take values other
than the ROI values in the atlas). Not sure if I can embed images - if so,
see the attached for an example:

[image: image.png]

The output is the same whether I include the --resample_type nearest flag
or leave it out, making me think that mri_convert is ignoring the flag and
using the default interp option.

This can be replicated in the relatively current version
"freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b" as well as the
older "$Id: recon-all,v 1.379.2.73 2013/05/12 23:15:37 nicks Exp $" (which
we keep around for old pipeline compatibility).

Any ideas on how to fix this so the ROI interfaces take appropriate
(nearest neighbor) values rather than interpolated values?

Thanks all!

Jim H.
___
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is 
addressed.  If you believe this e-mail was sent to you in error and the e-mail 
contains patient information, please contact the Mass General Brigham 
Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline 
 .
Please note that this e-mail is not secure (encrypted).  If you do not wish to 
continue communication over unencrypted e-mail, please notify the sender of 
this message immediately.  Continuing to send or respond to e-mail after 
receiving this message means you understand and accept this risk and wish to 
continue to communicate over unencrypted e-mail.