[MINC-development] mincmorph 1.4 (the probable replacement for binop)

Andrew Janke minc-development@bic.mni.mcgill.ca
Tue, 25 Feb 2003 19:13:36 +1000


I have finally managed to finish this problem child.

   /software/source/minc_dev/mincmorph

Up 'till now the Group (Connected Component Labelling) bit might have worked in
some cases but was generally broken.  It now works, well at least untill one of
you lot break it. :)

The major change is that the NC_FLOAT datatype is used internally.  This has
obvious ramifications WRT memory use, but I was becomming very ticked off with
range problems that crop up due to the many combinations of operators. (ie
gray-level dilation combined with CCL...)


ie: to label all the groups (in ascending order) in the file in.mnc between the
values of 10 and 100.

   mincmorph -successive 'B[10:100]G' in.mnc out.mnc

Because the groups are ascending you can then use minmath to get the 2 largest
groups or just add a bit to the command above:

   mincmorph -successive 'B[10:100]GK[0:2]' in.mnc out.mnc

But why stop there? Let's dilate it a bit:

   mincmorph -successive 'B[10:100]GK[0:2]DDDD' in.mnc out.mnc

And just to show off, compute a distance transform

   mincmorph -successive 'B[10:100]GK[0:2]DDDDF' in.mnc out.mnc

And then do sobel edge detection... (assuming that you've made sobel.kern)

   mincmorph -successive 'B[10:100]GK[0:2]DDDDFR[sobel.kern]X' in.mnc out.mnc


For this matter all the operations are WRT an input kernel, a 3x3x3 8
connectivity kernel is the default.  This means that you can finally do those
Erosions and Dilations in the transverse direction (or coronal) for that matter.



As always, comments, criticism and invitations of finding a real life accepted.


--
Andrew Janke   ( rotor@cmr.uq.edu.au || www.cmr.uq.edu.au/~rotor )
Australia->University of Queensland->Centre for Magnetic Resonance
Work: +61 7 3365 4100 || Home: +61 7 3800 4042