Hi Michael,
there is a function cg_morph_vol.m in the VBM8 toolbox (http://dbm.neuro.uni-jena.de/vbm8), that allows morphological closing and opening. Furthermore, you can try the old cleanup approach, that is available as modified version in cg_cleanup_gwc.m. However, I achieved the best results by using a combination of different opening and closing steps (see code below; cls{x} are the 6 tissue classes from "New Segment"). I use this code to apply a final mask, but the old cleanup procedure is still necessary for brains with large atrophy. Thus, I have again added this cleanup function to the toolbox.
If you want to use the skull-stripping of VBM8 you can save a (PVE) label image (also in native space) and simply threshold using imcalc with "i1>0". I have validated (and optimized) the results with the Segmentation Validation Engine (SVE) by David Shattuck:
http://sve.loni.ucla.edu/archive
The results for the actual VBM8 toolbox are id #148. I have also tried to use an external brainmask based on the LPBA40 labeled data set (id #77). However, this approach was not that stable for a large variety of data and often failed for brains with large atrophy (even if its best for the SVE data set). The result with the New Segment Toolbox of spm8b is id #56 (thresholded sum of GM+WM+CSF).
Regards,
Christian
% create final mask
mask = single(cls{1});
mask = mask + single(cls{2});
% keep largest connected component after 2 its of opening
mask = cg_morph_vol(mask,'open',2,0.5);
mask = mask_largest_cluster(mask,0.5);
% dilate and close to fill ventricles
mask = cg_morph_vol(mask,'dilate',2,0.5);
mask = cg_morph_vol(mask,'close',10,0.5);
On Thu, 20 May 2010 12:31:42 -0500, Michael Harms <[log in to unmask]> wrote:
>Hello,
>Is there a way to perform a 3D morphological closing operation (i.e.,
>dilation followed by erosion) from within SPM?
>
>In particular, I want to create a "brain" mask in subject space defined
>by thresholding the sum of c1+c2+c3 from Segment, and then clean up that
>mask a little bit (in an automated fashion) through morphological
>closing and filling. Initially I thought I could accomplish this using
>an appropriately constructed expression in ImCalc by taking advantage of
>Matlab's 'imclose' and 'imfill' functions. However, spm_imcalc.m
>appears to perform all calcs in a plane-by-plane manner. Thus any
>3D morphological component in the expression in ImCalc will be
>ignored, and a 2D operation will be performed (since only a 2D input is
>available at each evaluation).
>
>Is there a way around this within SPM? Or some other mechanism/function
>for "cleaning" up a mask defined by c1+c2+c3?
>
>I could of course do the operation in Matlab outside of SPM's functions,
>but my first inclination is to try to accomplish it within SPM to keep the
>overall scripting simpler.
>
>thanks,
>-Mike H.
>
>--
>Michael Harms, Ph.D.
>--------------------------------------------------------------------
>Conte Center for the Neuroscience of Mental Disorders
>Washington University School of Medicine
>Department of Psychiatry, Box 8134
>Renard Hospital, Room 6604 Tel: 314-747-6173
>660 South Euclid Ave. Fax: 314-747-2182
>St. Louis, MO 63110 Email: [log in to unmask]
>--------------------------------------------------------------------
|