From: Francis Burton on
I have a colleague who is attempting to do 3D deconvolution using the
deconvlucy function. Both image stack and point spread function are 3D
arrays. However, he is consistently getting the error:

"Subscript indices must either be real positive integers or logicals."

when

deconvlucy(image,psf,10,[],[],[],compFac); % compFac=100 typically

is called. How can I find out what is going awry? Are there any examples
of 3D convolution code out there? I couldn't find any!

Francis
From: us on
Francis Burton <fburton(a)nyx.net> wrote in message <1265024789.847210(a)irys.nyx.net>...
> I have a colleague who is attempting to do 3D deconvolution using the
> deconvlucy function. Both image stack and point spread function are 3D
> arrays. However, he is consistently getting the error:
>
> "Subscript indices must either be real positive integers or logicals."
>
> when
>
> deconvlucy(image,psf,10,[],[],[],compFac); % compFac=100 typically
>
> is called. How can I find out what is going awry? Are there any examples
> of 3D convolution code out there? I couldn't find any!
>
> Francis

just a few thoughts...

- where in DECONVLUCY does the error occur
- did he/she do a
dbstop if error;
and look at the data

us
From: Francis Burton on
In article <hk6hgv$mm4$1(a)fred.mathworks.com>, us <us(a)neurol.unizh.ch> wrote:
>just a few thoughts...

Always welcome!

>- where in DECONVLUCY does the error occur

??? Subscript indices must either be real positive integers or logicals.

Error in ==> deconvlucy>parse_inputs at 296
J{4}(prod(sizeI)*SUBSMPL^length(numNSdim),2) = 0;

Error in ==> deconvlucy at 100
[J,PSF,NUMIT,DAMPAR,READOUT,WEIGHT,SUBSMPL,sizeI,classI,sizePSF,numNSdim]=...

Error in ==> stusDeconv at 56
outpla=deconvlucy(image, psf,10,[],[],[],compFac); % compFac=10 not 100

Error in ==> pseudoPSF at 46
stusDeconv(img,threeDPSF);

>> dbstop if error
>> pseudoPSF

??? Subscript indices must either be real positive integers or logicals.

Error in ==> deconvlucy>parse_inputs at 296
J{4}(prod(sizeI)*SUBSMPL^length(numNSdim),2) = 0;

K>> J

J =
[512x512x31 double] [512x512x31 double] [0] []

K>> J{4}

ans =
[]

K>> sizeI

sizeI =
512 512 31

K>> SUBSMPL

SUBSMPL =
10

K>> numNSdim

numNSdim =
1 2 3

K>> prod(sizeI)*SUBSMPL^length(numNSdim)

ans =
8.1265e+009

I suspect this is the problem.

It turns out that compFac (=SUBSMPL) should actually be much
closer to 1, the default value. With compFac set to 1, the
error does not occur and the function produces what looks a
bit more like a deconvolved image stack.

I think it would have been useful if deconvlucy had complained
about SUBSMPL being too large (if that is indeed what the
problem was) rather than giving the message it did. Examples
of using deconvlucy with 3D arrays - the typical scenario
in cell microscopy - would have been useful too.

Francis
From: Francis Burton on
In article <1265127817.216025(a)irys.nyx.net>,
Francis Burton <fburton(a)nyx.net> wrote:
>It turns out that compFac (=SUBSMPL) should actually be much
>closer to 1, the default value. With compFac set to 1, the
>error does not occur and the function produces what looks a
>bit more like a deconvolved image stack.

.... the problem now being that the dynamic range of the resulting
images is very low (typically 0 to <10). My colleague is giving
deconvlucy what seems like reasonable input - an "ellipsoidal"
Gaussian point spread function and an image stack with reasonable
dynamic range - but the output is unusable. He is currently
pulling his hair out as to how to proceed, frustrated that MATLAB
cannot do the Super Whizzo things that the ImageJ plugins can
(with the same data). I suggested that he gets MATLAB to "call"
ImageJ to do the deconvolution, but that seems a bit like
admitting defeat. However, without any example code to study
and no documentation on how best to apply deconvlucy to 3D data,
MATLAB doesn't seem the best tool for the job.

Francis