prepare_single_shell errors

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Thu Mar 22 17:47:00 CET 2007


Hi Sameer,

The second input of prepare_singleshell should be a segmented MRI
(i.e the output of VOLUMESEGMENT) and not an original gray-value MRI.

On 22 Mar 2007, at 17:09, Sameer Walawalkar wrote:
> I am trying to use prepare_singleshell to try and get a single
> shell model using brain surface from segmented mri.
>
> I try to generate this segmented mri using (is this correct)
>
>>> [mri]=
> read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/
> mri/T1-neuromag/sets/COR.fif')
>
> mri =
>
>           dim: [256 256 256]
>       anatomy: [256x256x256 uint8]
>           hdr: [1x1 struct]
>     transform: [4x4 double]

The anatomy here contains (that is what I suspect) all values between
0 and 255 that, when plotted, represent the anatomical MRI.

> The file COR.fif is acquired by implementing  mne_setup_mri of MNE-
> suite, and it in turn acts upon freeserfer treatment of dicom files
> of mri data.

The output of volumesegment would contain
   mri.gray  256^3
   mri.white 256^3
   mri.csf   256^3
subsequently what prepare_singleshell does (see the first part in the
code) is
   seg = zeros(mri.dim);
   if isfield(mri, 'gray')
     fprintf('including gray matter in segmentation for brain
compartment\n')
     seg = seg | (mri.gray>(cfg.threshold*max(mri.gray(:))));
   end
   if isfield(mri, 'white')
     fprintf('including white matter in segmentation for brain
compartment\n')
     seg = seg | (mri.white>(cfg.threshold*max(mri.white(:))));
   end
   if isfield(mri, 'csf')
     fprintf('including CSF in segmentation for brain compartment\n')
     seg = seg | (mri.csf>(cfg.threshold*max(mri.csf(:))));
   end
i.e. it fuses gray+white+csf into a single black-white 3-D volume
that represents the skull content. Around that part of the 3-D volume
the triangulation is constructed. Note that the mri.transform has to
be correct and match with the headcoordinates of the gradiometers
(you can use  VOLUMEREALIGN if the coordinates are not properly
aligned yet).

Robert



More information about the fieldtrip mailing list