"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
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
... 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