[MINC-users] Getting max and min in a sphere centered at each voxel

Alex Zijdenbos zijdenbos at gmail.com
Thu Jul 5 20:10:25 EDT 2012


Ah - so mincmorph actually does grey level morphology? Somehow I've only ever used it for binary morphology. Nice.  

However, I do think you meant:

mincmorph -3D26 -erosion in.mnc min.mnc
mincmorph -3D26 -dilation in.mnc max.mnc

Then with this perl script:

 ​make_mincmorph_kernel.pl (http://cl.ly/2420323b382t2z3p3E3N)

you can generate spherical kernels of arbitrary size; but yes it will get a bit slow for large ones. I have generated 10x10x10 kernels though and that is all still very doable (you couldn't finish your coffee in the time it takes to run).

-- A

On Thursday, 5 July, 2012 at 5:53 PM, Andrew Janke wrote:  
> mincmorph will also do this but only behaves well for small
> structuring elements (up to 5x5). Beyond that it's a tad slow.
>  
> You should be able to get a rough hack at what you want with something
> like this for a 3x3x3 structuring element to start with:
>  
> mincmorph -3D26 -erode in.mnc max.mnc
> mincmorph -3D26 -dilate in.mnc min.mnc
>  
> This should then get what you want across the whole volume in min.mnc
> and max.mnc.
>  
>  
> a
>  
> On 6 July 2012 07:49, Vladimir S. FONOV <vladimir.fonov at gmail.com (mailto:vladimir.fonov at gmail.com)> wrote:
> > Then you would need to use gray-scale morphology and perform dilation to get
> > max and erosion for min. I have a tool based on ITK which does that .
> >  
> >  
> > On 12-07-05 04:39 PM, francois hebert wrote:
> > >  
> > > Hi,
> > >  
> > > you suggestion seems good for one voxel but I would like a filter that
> > > will
> > > go through all the voxels.
> > >  
> > > Francois Hebert
> > >  
> > > 2012/7/5 Vladimir S. FONOV <vladimir.fonov at gmail.com (mailto:vladimir.fonov at gmail.com)>
> > >  
> > > > Hello,
> > > >  
> > > >  
> > > > On 12-07-05 03:38 PM, francois hebert wrote:
> > > >  
> > > > > I would like to know if there is a minc tool that allow to get the max
> > > > > and
> > > > > min inside a sphere of a predefined diameter at each voxel.
> > > > >  
> > > >  
> > > >  
> > > > i would think make_phantom to create a spherical mask followed by
> > > > mincstats -min -max
> > > >  
> > > > --
> > > > Best regards,
> > > >  
> > > > Vladimir S. FONOV ~ vladimir <dot> fonov <at> gmail <dot> com
> > > >  
> > > >  
> > > > ______________________________**_________________
> > > > MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca)
> > > >  
> > > > http://www.bic.mni.mcgill.ca/**mailman/listinfo/minc-users<http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users>
> > > _______________________________________________
> > > MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca)
> > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
> > >  
> >  
> >  
> >  
> > --
> > Best regards,
> >  
> > Vladimir S. FONOV ~ vladimir <dot> fonov <at> gmail <dot> com
> >  
> >  
> > _______________________________________________
> > MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca)
> > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
> >  
>  
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca (mailto:MINC-users at bic.mni.mcgill.ca)
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>  
>  




More information about the MINC-users mailing list