Re: Trouble running "Custom filter..." from plugin
Posted by
Gluender-3 on
Mar 16, 2010; 9:59am
URL: http://imagej.273.s1.nabble.com/Trouble-running-Custom-filter-from-plugin-tp3688954p3688957.html
Neil,
not sure, but the IJ-manual (always a good source for inspiration) says:
"There is no arbitrary limit to the size of the kernel but it must be
square and have an odd width."
>Hi list,
>
>I'm not getting the results I expect when I call the "Custom Filter..." menu
>command from a plugin. I'm writing a plugin that iteratively applies a
>custom filter to a series of small pixel blocks of the input image. All
>images are 32 bit floats. Here is a schematic of the steps I take:
>
>- Create a filter image block, a 4x4px imageplus (imFilter) in a window
>titled "Filter"
>- For simple testing I'm using a filter where the values are unity at the
>edges and zero elsewhere:
> 1 1 1 1
> 1 0 0 1
> 1 0 0 1
> 1 1 1 1
>- I create a new image from the original image (imp) to form my current
>"block" (imBlock), again a 4x4 square image block
>- For testing I'm forcing the values in this block to have known values:
> 0 1 2 3
> 0 0 0 0
> 4 5 6 7
> 0 0 0 0
>- I use "Custom Filter..." to filter imBlock with imFilter.
>
>If I do the Custom Filter manually by using the menus I get an image block
>that appears smoothed, which I'm expecting. But if I try to automate this
>in my plugin, the image block ends up as just a 4x4 image with zero-valued
>pixels everywhere.
>
>The command I'm using to call the filter is:
> ij.IJ.run(imBlock, "Custom Filter...", "filter=[Filter]");
>
>Is there something implicitly wrong with the way I am calling the filter?
>Any suggestions/criticisms would be gratefully received.
>
>Many thanks, Neil
HTH
--
Herbie
------------------------
<
http://www.gluender.de>