External Email - Use Caution        

All, 

I've tried the dev version with FS_HISTO_STD_THRESH set to 20, but I am seeing the same error message.

hayashis@xps15-9560:~/test/deface/app-deface(master*) $ export FS_HISTO_STD_THRESH=20
hayashis@xps15-9560:~/test/deface/app-deface(master*) $ ./mri_deface ../t1.nii.gz $FREESURFER_HOME/average/talairach_mixed_with_skull.gca $FREESURFER_HOME/average/face.gca t1.nii.gz
logging results to t1.nii.log
reading '/home/hayashis/app/freesurfer-dev/average/talairach_mixed_with_skull.gca'...
reading '../t1.nii.gz'...
changing type of input volume to 8 bits/voxel...
MRIchangeType: Building histogram 0 255 1000, flo=0, fhi=0.999, dest_type=0
bounding unknown intensity as < 10.3 or > 1461.6
total sample mean = 111.8 (0 zeros)
spacing=8, using 2055 sample points, tol=1.00e-03...
resetting wm mean[0]: 143 --> 144
resetting gm mean[0]: 89 --> 89
input volume #1 is the most T1-like
using real data threshold=11.0
skull bounding box = (49, 43, 9) --> (207, 213, 219)
finding center of left hemi white matter
using (102, 100, 114) as brain centroid of Right_Cerebral_White_Matter...
mean wm in atlas = 144, using box (83,79,88) --> (121, 120,139) to find MRI wm
before smoothing, mri peak at 77
robust fit to distribution - 78 +- 5.8
distribution too broad for accurate scaling - disabling
WARNING2: gca.c::GCAhistoScaleImageIntensities: h_mri->nbins=113, mri_peak=144
after smoothing, mri peak at 0, scaling input intensities by inf
GCAhistoScaleImageIntensities: could not find wm peak
Numerical result out of range

I've checked the binary but it doesn't look like this binary contains any reference to FS_HISTO_STD_THRESH parameter.

hayashis@xps15-9560:~/Downloads $ strings mri_deface | grep FS_HISTO
hayashis@xps15-9560:~/Downloads 1 

Did I download the right binary?

Soichi

On Mon, Aug 5, 2019 at 3:04 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu> wrote:
no, the env variable won't change that. You can try changing the radius
with:

-radius <n>

where n=7 by default. Smaller will make it more aggressive.

cheers
Bruce
On Mon, 5 Aug
2019, Brian Biekman wrote:

>        External Email - Use Caution
>
> I am also using pediatric brains and am also interesting in using your defacing algorithm. I downloaded your updated script and changed the environment variable but it leaves a lot of the jaw and chin. Is this something that can be fixed by changing the environment variable to some custom value?
>
> --
> Brian Biekman
> Graduate Student, University of Houston
> Clinical Psychology, Neuropsychology Concentration
> Laboratory of Early Experience and Development (LEED)
> bdbiekman@uh.edu
> Brian.Biekman@times.uh.edu
>
> ________________________________________
> From: freesurfer-bounces@nmr.mgh.harvard.edu [freesurfer-bounces@nmr.mgh.harvard.edu] on behalf of Hoopes, Andrew [AHOOPES@mgh.harvard.edu]
> Sent: Monday, August 05, 2019 12:25 PM
> To: Freesurfer support list
> Subject: Re: [Freesurfer] [External] Re: mri_deface fails on pediatric brain
>
> Hi Soichi, you can update mri_deface with:
>
> curl https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/dev_binaries/centos7_x86_64/mri_deface -o $FREESURFER_HOME/bin/mri_deface
> chmod +x $FREESURFER_HOME/bin/mri_deface
>
> Then, before running mri_deface, set the env variable:
>
> export FS_HISTO_STD_THRESH=20
>
> Then, it should print out something like:
>
> mean wm in atlas = 144, using box (79,77,96) --> (120, 132,144) to find MRI wm before smoothing, mri peak at 76
> FS_HISTO_STD_THRESH found in the environment resetting from 10 to 20.0
> robust fit to distribution - 76 +- 6.5
> after smoothing, mri peak at 76, scaling input intensities by 1.895
> mean wm in atlas = 144, using box (79,77,96) --> (120, 132,144) to find MRI wm before smoothing, mri peak at 76
> FS_HISTO_STD_THRESH found in the environment resetting from 10 to 20.0
> robust fit to distribution - 76 +- 6.5
> after smoothing, mri peak at 76, scaling input intensities by 1.895
>
>
> ________________________________________
> From: freesurfer-bounces@nmr.mgh.harvard.edu <freesurfer-bounces@nmr.mgh.harvard.edu> on behalf of Soichi Hayashi <hayashis@iu.edu>
> Sent: Monday, August 5, 2019 11:32 AM
> To: Freesurfer support list
> Subject: Re: [Freesurfer] [External] Re: mri_deface fails on pediatric brain
>
>        External Email - Use Caution
>
> We run on our freesurfer through singularity/docker container, and we are currently using Centos7 as the base image to build our freesurfer container, but we can run it on any other Linux based OSes. As far as our hardware goes, we run on variety of hardware including HPC system, public and private cloud platforms and a few dedicated desktop machines at our labs.
>
> Thanks!
> Soichi
>
> On Sun, Aug 4, 2019 at 10:55 PM Bruce Fischl <fischl@nmr.mgh.harvard.edu<mailto:fischl@nmr.mgh.harvard.edu>> wrote:
> Hi Soichi
>
> I have a fix for you. Can you let us know what kind of hardware/software
> env you are running in and we will send it to you?
>
> cheers
> Bruce
>
>
> On Sun, 4 Aug 2019, Soichi Hayashi wrote:
>
>>
>>         External Email - Use Caution
>>
>> Bruce,
>> I've uploaded one of the failed subject to surfer.nmr.mgh.harvard.edu<http://surfer.nmr.mgh.harvard.edu> ftp
>> server (named t1.nii.gz).Thank you for looking into this problem.
>>
>> Soichi
>>
>> On Sun, Aug 4, 2019 at 10:35 AM Bruce Fischl <fischl@nmr.mgh.harvard.edu<mailto:fischl@nmr.mgh.harvard.edu>>
>> wrote:
>>       This message was sent from a non-IU address. Please exercise
>>       caution when clicking links or opening attachments from
>>       external sources.
>>       -------
>>
>>       Hi Soichi
>>
>>       mri_deface isn't really supported anymore, but if you upload a
>>       subject
>>       that fails I'll take a look. I would have thought in the ABCD
>>       subject age
>>       range it would work
>>
>>       cheers
>>       Bruce
>>       On Sat, 3 Aug 2019, Soichi Hayashi wrote:
>>
>>      >
>>      >         External Email - Use Caution
>>      >
>>      > Hello.
>>      >
>>      > We are running mri_deface on subjects from ABCD (Adolescent
>>       Brain Cognitive
>>      > Development) study and many of the subjects are failing on
>>       mri_deface.
>>      >
>>      >       $ mri_deface t1.nii.gz
>>      >       $FREESURFER_HOME/average/talairach_mixed_with_skull.gca
>>      >       $FREESURFER_HOME/average/face.gca defaced.nii.gz
>>      >       logging results to defaced.nii.log
>>      >       reading
>>      >
>>        '/usr/local/freesurfer/average/talairach_mixed_with_skull.gca'...
>>      >       reading 't1.nii.gz'...
>>      >       changing type of input volume to 8 bits/voxel...
>>      >       MRIchangeType: Building histogram
>>      >       bounding unknown intensity as < 10.3 or > 1461.6
>>      >       total sample mean = 111.8 (0 zeros)
>>      >       spacing=8, using 2055 sample points, tol=1.00e-03...
>>      >       resetting wm mean[0]: 143 --> 144
>>      >       resetting gm mean[0]: 89 --> 89
>>      >       input volume #1 is the most T1-like
>>      >       using real data threshold=11.0
>>      >       skull bounding box = (54, 38, 18) --> (205, 255, 220)
>>      >       using (104, 110, 119) as brain centroid...
>>      >       mean wm in atlas = 144, using box (85,83,94) --> (122,
>>       136,143)
>>      >       to find MRI wm
>>      >       before smoothing, mri peak at 79
>>      >       robust fit to distribution - 80 +- 8.7
>>      >       distribution too broad for accurate scaling - disabling
>>      >       WARNING2: gca.c::GCAhistoScaleImageIntensities:
>>      >       h_mri->nbins=111, mri_peak=140
>>      >       after smoothing, mri peak at 0, scaling input
>>       intensities by
>>      >       inf
>>      >       GCAhistoScaleImageIntensities: could not find wm peak
>>      >       Numerical result out of range
>>      >
>>      >
>>      > Should talairach_mixed_with_skull.gca template work with
>>       pediatric
>>      > subjects? Or is there a different template we must choose? Or
>>       maybe any
>>      > parameters that we could tweak to get it work better?
>>      >
>>      > Thanks!
>>      > Soichi
>>      >
>>      >
>>
>>
>>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
> _______________________________________________
> Freesurfer mailing list
> Freesurfer@nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
>
>
>
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer