Selective Convolution [message #71682] |
Tue, 13 July 2010 11:32 |
James[2]
Messages: 44 Registered: November 2009
|
Member |
|
|
Hi Everyone,
I am getting some painfully slow execution times dominated by running
CONVOL on three-dimensional arrays. I'm working with a sparse data
set of blood vessel images. I'm only interested in calculating the
field _inside_ the blood vessels, so the vast majority of the array is
empty space that I don't care about. I'd like to instruct CONVOL to
only calculate convolutions inside the blood vessels, but when I try
to do this:
;example, simpler version of what I'm doing
x[nonzero] += r*convol(x[nonzero], pdvkern)
IDL complains, and rightfully so: the subscripted array is now one-
dimensional, and it doesn't make sense to convolve it by a 3D kernel.
My first thought was setting the empty space to NaN values, but the
NaN keyword to CONVOL does the opposite of what I want - it replaces
NaN values with the convolution of real values, and ignores NaN values
in the convolution of "good" elements. I don't ever want to replace a
NaN value with a convolved value, but I would like to treat NaN values
as zeroes when calculating the convolution of "good" elements.
So, I'm thinking I might have to write a C routine for selective
convolution. Any other ideas for how to overcome this?
Thanks,
James Preiss
|
|
|