[MINC-users] Custom kernels in mincmorph

Andrew Janke a.janke at gmail.com
Thu Nov 15 09:46:42 EST 2007


> > Given that you seem to have the source take a look in the kernels/
> > directory in the mincmorph package, there are a few examples in there.
>
> I'm not sure where to look:
> tar ztf mincmorph-1.4.tar.gz | grep kernel
> mincmorph-1.4/kernel_io.c
> mincmorph-1.4/kernel_ops.c
> mincmorph-1.4/kernel_io.h
> mincmorph-1.4/kernel_ops.h
>
> I have the source from http://packages.bic.mni.mcgill.ca/tgz/

OK, I will rephrase that to "there should be a directory...."  seems
that it missed the make dist. <sigh>.  In any case here is an example
of a mincmorph 2D sobel edge detector. Note that anything starting
with % is a comment.

Each line in the kernel file represents on point in a structuring
element/kernel and is described as a delta/offset from the 0 position.
 My bit of dodgy ASCII art at the top in the comments should explain
things somewhat.

I will have a look into the bug.



a

---cut here---

MNI Morphology Kernel File
%
% 2D sobel edge detector ie:
%
%   1  2  1
%   0  0  0
%  -1 -2 -1
%
% 0 - center voxel
% Format:  offset for voxel in 5 dimensions (x,y,z,t,v) then multiplier.

Kernel_Type = Normal_Kernel;
Kernel =
%    x    y    z    t    v     coeff
% -----------------------------------
  -1.0  1.0  0.0  0.0  0.0     1.0
   0.0  1.0  0.0  0.0  0.0     2.0
   1.0  1.0  0.0  0.0  0.0     1.0
%
  -1.0  0.0  0.0  0.0  0.0     0.0
   0.0  0.0  0.0  0.0  0.0     0.0
   1.0  0.0  0.0  0.0  0.0     0.0
%
  -1.0 -1.0  0.0  0.0  0.0    -1.0
   0.0 -1.0  0.0  0.0  0.0    -2.0
   1.0 -1.0  0.0  0.0  0.0    -1.0;

---and here---


More information about the MINC-users mailing list