Re: [Freesurfer] Manual correction for brainstem module

2016-05-13 Thread Jacky Lee
Just a short note for other people who may use the matlab script to get
volumes from the corrected hard segmentations. The volume in cubic mm
should be total voxels divided by 8 instead of multiplying by 8.

Cheers,
Jacky

2016-05-12 17:44 GMT+02:00 Eugenio Iglesias <e.igles...@bcbl.eu>:

> Yes! But take all the medulla volumes from the script. In other words: do
> not use the script to compute the medulla volumes of the cases you edited,
> and take the medulla volumes from the text file for all other cases. If you
> do that, you'd be introducing a fairly ugly bias in the study.
> Cheers,
> /E
>
>
> Juan Eugenio Iglesias
> Postdoctoral researcher BCBL
> www.jeiglesias.com
> www.bcbl.eu
>
> Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer
>
> --
> *From: *"Jacky Lee" <cyle...@gmail.com>
> *To: *"Eugenio Iglesias" <e.igles...@bcbl.eu>
> *Cc: *"Freesurfer support list" <freesurfer@nmr.mgh.harvard.edu>
> *Sent: *Thursday, May 12, 2016 4:11:20 PM
>
> *Subject: *Re: [Freesurfer] Manual correction for brainstem module
>
> Hi Eugenio,
>
> Thanks, the script worked.
>
> Actually I only edited the medulla segmentation in 3 out of the 49
> subjects that I have. I suppose the original volumetric estimates for
> midbrain and pons are still valid and I can just calculate and compare the
> new medulla volumes for all subjects. Is that correct?
>
> Jacky
>
> 2016-05-12 12:05 GMT+02:00 Eugenio Iglesias <e.igles...@bcbl.eu>:
>
>> My email client is replacing the combination colon + right parenthesis by
>> a smiley! If the same thing happened to you, please replace the smiley by a
>> colon and a right parenthesis...
>> Next time I'll just attach the code.
>> Sorry for the inconvenience
>>
>> Juan Eugenio Iglesias
>> Postdoctoral researcher BCBL
>> www.jeiglesias.com
>> www.bcbl.eu
>>
>> Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer
>>
>> ----------
>> *From: *"Eugenio Iglesias" <e.igles...@bcbl.eu>
>> *To: *"Jacky Lee" <cyle...@gmail.com>
>> *Cc: *"Freesurfer support list" <Freesurfer@nmr.mgh.harvard.edu>
>> *Sent: *Thursday, May 12, 2016 5:59:33 AM
>>
>> *Subject: *Re: [Freesurfer] Manual correction for brainstem module
>>
>> Of course! I haven't tested the code below, but I think it should work
>> right away.
>>
>> Let's assume that FreeSurfer is installed in /usr/local/freesurfer/ (if
>> not, replace the location in the code below). Also, you'd need to replace
>> the name of your subject directory.
>> Finally, I have assumed that brainstemSsLabels.v10.mgz was modified and
>> saved as  brainstemSsLabels.v10.edited.mgz  (again, replace as needed).
>>
>>
>> subjectdir='/mysubjectdir/';
>> editedFileName='brainstemSsLabels.v10.edited.mgz';
>>
>> addpath /usr/local/freesurfer/matlab
>>
>> d=dir(subjectdir);
>>
>> for i=1:length(d)
>>
>>   tentativeSegFile=[subjectdir '/' d(i).name '/mri/' editedFileName];
>>
>>   if d(i).isdir && exist(tentativeSegFile,'file')
>>
>> A=MRIread(tentativeSegFile);
>> MidbrainVol=8*sum(A.vol(:)==173);   % the eight is because each voxel
>> of the segmentation has a volume equal to 0.125 cubic mm
>> PonsVol=8*sum(A.vol(:)==174);
>> MedullaVol=8*sum(A.vol(:)==175);
>> SCPvol=8*sum(A.vol(:)==178);
>>
>> disp(['Subject ' d(i).name ', midbrain = ' num2str(MidbrainVol) ',
>> pons = ' num2str(PonsVol) ', medulla = ' num2str(MedullaVol) ', SCP = '
>> num2str(SCPvol)]);
>>
>>   end
>>
>> end
>>
>> One more thing: if you haven't edited anything around the SCP, I would
>> use the original estimate for this structure. The reason is that, because
>> the SCP is very thing, the voxel count is a much poorer approximation for
>> the volume as computed by the code (i.e., using soft segmentations).
>>
>> Cheers,
>>
>> Eugenio
>>
>>
>> Juan Eugenio Iglesias
>> Postdoctoral researcher BCBL
>> www.jeiglesias.com
>> www.bcbl.eu
>>
>> Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer
>>
>> --
>> *From: *"Jacky Lee" <cyle...@gmail.com>
>> *To: *"Freesurfer support list" <Freesurfer@nmr.mgh.harvard.edu>
>> *Cc: *"Eugenio Iglesias" <e.igles...@bcbl.eu>
>> *Sent: *Thursday, May 12, 2016 10:32:24 AM
>> *Subje

Re: [Freesurfer] Manual correction for brainstem module

2016-05-12 Thread Eugenio Iglesias
Yes! But take all the medulla volumes from the script. In other words: do not 
use the script to compute the medulla volumes of the cases you edited, and take 
the medulla volumes from the text file for all other cases. If you do that, 
you'd be introducing a fairly ugly bias in the study. 
Cheers, 
/E 


Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Jacky Lee" <cyle...@gmail.com> 
To: "Eugenio Iglesias" <e.igles...@bcbl.eu> 
Cc: "Freesurfer support list" <freesurfer@nmr.mgh.harvard.edu> 
Sent: Thursday, May 12, 2016 4:11:20 PM 
Subject: Re: [Freesurfer] Manual correction for brainstem module 

Hi Eugenio, 

Thanks, the script worked. 

Actually I only edited the medulla segmentation in 3 out of the 49 subjects 
that I have. I suppose the original volumetric estimates for midbrain and pons 
are still valid and I can just calculate and compare the new medulla volumes 
for all subjects. Is that correct? 

Jacky 

2016-05-12 12:05 GMT+02:00 Eugenio Iglesias < e.igles...@bcbl.eu > : 



My email client is replacing the combination colon + right parenthesis by a 
smiley! If the same thing happened to you, please replace the smiley by a colon 
and a right parenthesis... 
Next time I'll just attach the code. 
Sorry for the inconvenience 

Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Eugenio Iglesias" < e.igles...@bcbl.eu > 
To: "Jacky Lee" < cyle...@gmail.com > 
Cc: "Freesurfer support list" < Freesurfer@nmr.mgh.harvard.edu > 
Sent: Thursday, May 12, 2016 5:59:33 AM 

Subject: Re: [Freesurfer] Manual correction for brainstem module 

Of course! I haven't tested the code below, but I think it should work right 
away. 

Let's assume that FreeSurfer is installed in /usr/local/freesurfer/ (if not, 
replace the location in the code below). Also, you'd need to replace the name 
of your subject directory. 
Finally, I have assumed that brainstemSsLabels.v10.mgz was modified and saved 
as brainstemSsLabels.v10.edited.mgz (again, replace as needed). 


subjectdir='/mysubjectdir/'; 
editedFileName='brainstemSsLabels.v10.edited.mgz'; 

addpath /usr/local/freesurfer/matlab 

d=dir(subjectdir); 

for i=1:length(d) 

tentativeSegFile=[subjectdir '/' d(i).name '/mri/' editedFileName]; 
if d(i).isdir && exist(tentativeSegFile,'file') 

A=MRIread(tentativeSegFile); 
MidbrainVol=8*sum(A.vol(:)==173); % the eight is because each voxel of the 
segmentation has a volume equal to 0.125 cubic mm 
PonsVol=8*sum(A.vol(:)==174); 
MedullaVol=8*sum(A.vol(:)==175); 
SCPvol=8*sum(A.vol(:)==178); 

disp(['Subject ' d(i).name ', midbrain = ' num2str(MidbrainVol) ', pons = ' 
num2str(PonsVol) ', medulla = ' num2str(MedullaVol) ', SCP = ' 
num2str(SCPvol)]); 

end 

end 

One more thing: if you haven't edited anything around the SCP, I would use the 
original estimate for this structure. The reason is that, because the SCP is 
very thing, the voxel count is a much poorer approximation for the volume as 
computed by the code (i.e., using soft segmentations). 

Cheers, 

Eugenio 

Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Jacky Lee" < cyle...@gmail.com > 
To: "Freesurfer support list" < Freesurfer@nmr.mgh.harvard.edu > 
Cc: "Eugenio Iglesias" < e.igles...@bcbl.eu > 
Sent: Thursday, May 12, 2016 10:32:24 AM 
Subject: Re: [Freesurfer] Manual correction for brainstem module 

Hi Eugenio, 

Yes please give me some advice on the matlab commands for this since I am not 
very familiar with matlab... 

Cheers, 

Jacky 

Hi Jacky, 
this is a good question, and unfortunately there isn't a great answer to it. 
The volume is computed upong a probabilitic segmentation of the voxels that is 
not written to disk (this is very similar to what happens with aseg.mgz and 
aseg.stats). In order to properly update the volume estimates, you would have 
to know the probability that the inpainted voxels belong to the brainstem as 
estimated by the algorithm, which we don't currently write to disk. 
Another option would be to toss the volumes given by the algorithm, and compute 
new volumes for all cases and brainstem structures using the hard 
segmentations. You would simply have to count the number of voxels labeled as 
midbrain, pons, SCP and medulla for each subject. You can easily do this e.g. 
with Matlab (let me know if you need help with this). 
Cheers, 
Eugenio 
Juan Eugenio Iglesias 
Postdoctoral researcher BCBL www.jeiglesias.com www.bcbl.eu Legal 
disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From: "Jacky 
Lee"

Re: [Freesurfer] Manual correction for brainstem module

2016-05-12 Thread Eugenio Iglesias
My email client is replacing the combination colon + right parenthesis by a 
smiley! If the same thing happened to you, please replace the smiley by a colon 
and a right parenthesis... 
Next time I'll just attach the code. 
Sorry for the inconvenience 

Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Eugenio Iglesias" <e.igles...@bcbl.eu> 
To: "Jacky Lee" <cyle...@gmail.com> 
Cc: "Freesurfer support list" <Freesurfer@nmr.mgh.harvard.edu> 
Sent: Thursday, May 12, 2016 5:59:33 AM 
Subject: Re: [Freesurfer] Manual correction for brainstem module 

Of course! I haven't tested the code below, but I think it should work right 
away. 

Let's assume that FreeSurfer is installed in /usr/local/freesurfer/ (if not, 
replace the location in the code below). Also, you'd need to replace the name 
of your subject directory. 
Finally, I have assumed that brainstemSsLabels.v10.mgz was modified and saved 
as brainstemSsLabels.v10.edited.mgz (again, replace as needed). 


subjectdir='/mysubjectdir/'; 
editedFileName='brainstemSsLabels.v10.edited.mgz'; 

addpath /usr/local/freesurfer/matlab 

d=dir(subjectdir); 

for i=1:length(d) 

tentativeSegFile=[subjectdir '/' d(i).name '/mri/' editedFileName]; 
if d(i).isdir && exist(tentativeSegFile,'file') 

A=MRIread(tentativeSegFile); 
MidbrainVol=8*sum(A.vol(:)==173); % the eight is because each voxel of the 
segmentation has a volume equal to 0.125 cubic mm 
PonsVol=8*sum(A.vol(:)==174); 
MedullaVol=8*sum(A.vol(:)==175); 
SCPvol=8*sum(A.vol(:)==178); 

disp(['Subject ' d(i).name ', midbrain = ' num2str(MidbrainVol) ', pons = ' 
num2str(PonsVol) ', medulla = ' num2str(MedullaVol) ', SCP = ' 
num2str(SCPvol)]); 

end 

end 

One more thing: if you haven't edited anything around the SCP, I would use the 
original estimate for this structure. The reason is that, because the SCP is 
very thing, the voxel count is a much poorer approximation for the volume as 
computed by the code (i.e., using soft segmentations). 

Cheers, 

Eugenio 

Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Jacky Lee" <cyle...@gmail.com> 
To: "Freesurfer support list" <Freesurfer@nmr.mgh.harvard.edu> 
Cc: "Eugenio Iglesias" <e.igles...@bcbl.eu> 
Sent: Thursday, May 12, 2016 10:32:24 AM 
Subject: Re: [Freesurfer] Manual correction for brainstem module 

Hi Eugenio, 

Yes please give me some advice on the matlab commands for this since I am not 
very familiar with matlab... 

Cheers, 

Jacky 

Hi Jacky, 
this is a good question, and unfortunately there isn't a great answer to it. 
The volume is computed upong a probabilitic segmentation of the voxels that is 
not written to disk (this is very similar to what happens with aseg.mgz and 
aseg.stats). In order to properly update the volume estimates, you would have 
to know the probability that the inpainted voxels belong to the brainstem as 
estimated by the algorithm, which we don't currently write to disk. 
Another option would be to toss the volumes given by the algorithm, and compute 
new volumes for all cases and brainstem structures using the hard 
segmentations. You would simply have to count the number of voxels labeled as 
midbrain, pons, SCP and medulla for each subject. You can easily do this e.g. 
with Matlab (let me know if you need help with this). 
Cheers, 
Eugenio 
Juan Eugenio Iglesias 
Postdoctoral researcher BCBL www.jeiglesias.com www.bcbl.eu Legal 
disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From: "Jacky 
Lee" < cyle...@gmail.com > 
To: "Freesurfer support list" < Freesurfer@nmr.mgh.harvard.edu > 
Sent: Monday, May 9, 2016 2:01:53 AM 
Subject: [Freesurfer] Manual correction for brainstem module 

Hi freesurfer experts, 

I have successfully run the brainstem module for some subjects. On visual 
checking, I can see there are voxels with T1 hypointense lesions mislabelled as 
non-brainstem tissue. I manually corrected them on the 
brainstemSsLabels.v10.mgz on Freeview. Then how do I obtain this new corrected 
volume of the brainstem substructures? 

Thanks. 

Regards, 

Jacky 


___ 
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 Partners Compliance HelpLine 
at 
http://www.partners.org/complianceline . If the e-mail was sent to you in error 
but does not contain patient information, please contact the sender and 
proper

Re: [Freesurfer] Manual correction for brainstem module

2016-05-12 Thread Eugenio Iglesias
Of course! I haven't tested the code below, but I think it should work right 
away. 

Let's assume that FreeSurfer is installed in /usr/local/freesurfer/ (if not, 
replace the location in the code below). Also, you'd need to replace the name 
of your subject directory. 
Finally, I have assumed that brainstemSsLabels.v10.mgz was modified and saved 
as brainstemSsLabels.v10.edited.mgz (again, replace as needed). 


subjectdir='/mysubjectdir/'; 
editedFileName='brainstemSsLabels.v10.edited.mgz'; 

addpath /usr/local/freesurfer/matlab 

d=dir(subjectdir); 

for i=1:length(d) 

tentativeSegFile=[subjectdir '/' d(i).name '/mri/' editedFileName]; 
if d(i).isdir && exist(tentativeSegFile,'file') 

A=MRIread(tentativeSegFile); 
MidbrainVol=8*sum(A.vol(:)==173); % the eight is because each voxel of the 
segmentation has a volume equal to 0.125 cubic mm 
PonsVol=8*sum(A.vol(:)==174); 
MedullaVol=8*sum(A.vol(:)==175); 
SCPvol=8*sum(A.vol(:)==178); 

disp(['Subject ' d(i).name ', midbrain = ' num2str(MidbrainVol) ', pons = ' 
num2str(PonsVol) ', medulla = ' num2str(MedullaVol) ', SCP = ' 
num2str(SCPvol)]); 

end 

end 

One more thing: if you haven't edited anything around the SCP, I would use the 
original estimate for this structure. The reason is that, because the SCP is 
very thing, the voxel count is a much poorer approximation for the volume as 
computed by the code (i.e., using soft segmentations). 

Cheers, 

Eugenio 

Juan Eugenio Iglesias 
Postdoctoral researcher BCBL 
www.jeiglesias.com 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Jacky Lee" <cyle...@gmail.com> 
To: "Freesurfer support list" <Freesurfer@nmr.mgh.harvard.edu> 
Cc: "Eugenio Iglesias" <e.igles...@bcbl.eu> 
Sent: Thursday, May 12, 2016 10:32:24 AM 
Subject: Re: [Freesurfer] Manual correction for brainstem module 

Hi Eugenio, 

Yes please give me some advice on the matlab commands for this since I am not 
very familiar with matlab... 

Cheers, 

Jacky 

Hi Jacky, 
this is a good question, and unfortunately there isn't a great answer to it. 
The volume is computed upong a probabilitic segmentation of the voxels that is 
not written to disk (this is very similar to what happens with aseg.mgz and 
aseg.stats). In order to properly update the volume estimates, you would have 
to know the probability that the inpainted voxels belong to the brainstem as 
estimated by the algorithm, which we don't currently write to disk. 
Another option would be to toss the volumes given by the algorithm, and compute 
new volumes for all cases and brainstem structures using the hard 
segmentations. You would simply have to count the number of voxels labeled as 
midbrain, pons, SCP and medulla for each subject. You can easily do this e.g. 
with Matlab (let me know if you need help with this). 
Cheers, 
Eugenio 
Juan Eugenio Iglesias 
Postdoctoral researcher BCBL www.jeiglesias.com www.bcbl.eu Legal 
disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer From: "Jacky 
Lee" < cyle...@gmail.com > 
To: "Freesurfer support list" < Freesurfer@nmr.mgh.harvard.edu > 
Sent: Monday, May 9, 2016 2:01:53 AM 
Subject: [Freesurfer] Manual correction for brainstem module 

Hi freesurfer experts, 

I have successfully run the brainstem module for some subjects. On visual 
checking, I can see there are voxels with T1 hypointense lesions mislabelled as 
non-brainstem tissue. I manually corrected them on the 
brainstemSsLabels.v10.mgz on Freeview. Then how do I obtain this new corrected 
volume of the brainstem substructures? 

Thanks. 

Regards, 

Jacky 

___
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 Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


[Freesurfer] Manual correction for brainstem module

2016-05-08 Thread Jacky Lee
Hi freesurfer experts,

I have successfully run the brainstem module for some subjects. On visual
checking, I can see there are voxels with T1 hypointense lesions
mislabelled as non-brainstem tissue. I manually corrected them on the
brainstemSsLabels.v10.mgz on Freeview. Then how do I obtain this new
corrected volume of the brainstem substructures?

Thanks.

Regards,

Jacky
___
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 Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.