wiggins-lab / SuperSegger

A completely automated MATLAB-based trainable image cell segmentation, fluorescence quantification and analysis suite, particularly well suited for high-throughput time lapse fluorescence microscopy of in vivo bacterial cells.
GNU General Public License v3.0
32 stars 20 forks source link

trackOptiAlignPad: Subscripted assignment dimension mismatch. #19

Closed ejliaw closed 6 years ago

ejliaw commented 6 years ago

Hello,

I'm a new user. I'd like to use SuperSegger to segment E. coli and quantify fluorescence, but on snapshots that are not part of a time-lapse series. I ran into the error below during segmentation (after <1 s). Perhaps I am not using SuperSegger as intended? Or did I trigger an edge case? Either way, I figured it might be helpful for you to know what rookie users will try to do, in case you want to build in informative error messages.

I opened up superSeggerGui, chose '60XEc', flagged 'Fluorescence Statistics' and 'Verbose', start step '1' end step '2' (or '10'), Foci '0, 0', Minimum Cell Age '0'. All other options were left as defaults. In the directory are 15 TIFF files named [basename]_xy[1 to 5]c[1 to 3].tif (or .TIF).

Here's info on one of the files, if it helps. I can also send you the images. Title: 180731a_tube0_xy5c1.tif Width: 1344 pixels Height: 1024 pixels Size: 2.6MB Bits per pixel: 16 (unsigned) Display range: 1201 - 5054 (These are the minimum and maximum values seen when I use imread() ).

Thanks for you help, Eric

trackOptiAlignPad : Image name: /pathToDirectoryLaLaLa/condition1/180731a_tube0_xy5c1.TIF
Subscripted assignment dimension mismatch.

Error in dftregistration (line 93)
    CC(m+1-fix(m/2):m+1+fix((m-1)/2),n+1-fix(n/2):n+1+fix((n-1)/2)) = ...

Error in intAlignIm (line 45)
    out = dftregistration(fftA,fftB,precision);

Error in trackOptiAlignPad>intFrameAlignXY (line 200)
                [out,errNum,focusNum] = intAlignIm(im_, phaseBef_, precision );

Error in parallel_function (line 478)
            consume(base, limit, F(base, limit, supply(base, limit)));

Error in trackOptiAlignPad (line 114)
parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142)
            crop_box_array = trackOptiAlignPad( dirname_,...

Error in superSeggerGui>segment_images_Callback (line 213)
    BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in superSeggerGui (line 38)
    gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject))
Error using isFocus (line 33)
Index exceeds matrix dimensions.

Error in intAlignIm (line 56)
focusNum = isFocus( fftA );

Error in trackOptiAlignPad>intFrameAlignXY (line 200)
                [out,errNum,focusNum] = intAlignIm(im_, phaseBef_, precision );

Error in trackOptiAlignPad (line 114)
parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142)
            crop_box_array = trackOptiAlignPad( dirname_,...

Error in superSeggerGui>segment_images_Callback (line 213)
    BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in superSeggerGui (line 38)
    gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject)) 
Error while evaluating UIControl Callback.
pawiggins commented 6 years ago

Hmmm… dftregistration was something I downloaded from the file exchange. Send me a minimal dataset where you get this issue and I’ll see what the problem is.

—PAW

On Aug 1, 2018, at 10:34 PM, ejliaw notifications@github.com wrote:

Hello,

I'm a new user. I'd like to use SuperSegger to segment E. coli and quantify fluorescence, but on snapshots that are not part of a time-lapse series. I ran into the error below during segmentation (after <1 s). Perhaps I am not using SuperSegger as intended? Or did I trigger an edge case? Either way, I figured it might be helpful for you to know what rookie users will try to do, in case you want to build in informative error messages.

I opened up superSeggerGui, chose '60XEc', flagged 'Fluorescence Statistics' and 'Verbose', start step '1' end step '2' (or '10'), Foci '0, 0', Minimum Cell Age '0'. All other options were left as defaults. In the directory are 15 TIFF files named [basename]_xy[1 to 5]c[1 to 3].tif (or .TIF).

Here's info on one of the files, if it helps. I can also send you the images. Title: 180731a_tube0_xy5c1.tif Width: 1344 pixels Height: 1024 pixels Size: 2.6MB Bits per pixel: 16 (unsigned) Display range: 1201 - 5054 (These are the minimum and maximum values seen when I use imread() ).

Thanks for you help, Eric

trackOptiAlignPad : Image name: /pathToDirectoryLaLaLa/condition1/180731a_tube0_xy5c1.TIF Subscripted assignment dimension mismatch.

Error in dftregistration (line 93) CC(m+1-fix(m/2):m+1+fix((m-1)/2),n+1-fix(n/2):n+1+fix((n-1)/2)) = ...

Error in intAlignIm (line 45) out = dftregistration(fftA,fftB,precision);

Error in trackOptiAlignPad>intFrameAlignXY (line 200) [out,errNum,focusNum] = intAlignIm(im, phaseBef, precision );

Error in parallel_function (line 478) consume(base, limit, F(base, limit, supply(base, limit)));

Error in trackOptiAlignPad (line 114) parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142) crop_boxarray = trackOptiAlignPad( dirname,...

Error in superSeggerGui>segment_images_Callback (line 213) BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in superSeggerGui (line 38) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject)) Error using isFocus (line 33) Index exceeds matrix dimensions.

Error in intAlignIm (line 56) focusNum = isFocus( fftA );

Error in trackOptiAlignPad>intFrameAlignXY (line 200) [out,errNum,focusNum] = intAlignIm(im, phaseBef, precision );

Error in trackOptiAlignPad (line 114) parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142) crop_boxarray = trackOptiAlignPad( dirname,...

Error in superSeggerGui>segment_images_Callback (line 213) BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in superSeggerGui (line 38) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wiggins-lab/SuperSegger/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/Amb9odx3-JxvxTyP4IBASyw0caAZ0Hiiks5uMo9ngaJpZM4VrqGi.

ejliaw commented 6 years ago

Hi Prof. Wiggins,

These images reproduce the error. I pulled SuperSegger from git yesterday. I'm running MATLAB R2017a on a 64-bit computer.

SuperSeggerIssue19.zip

Thanks, Eric

pawiggins commented 6 years ago

Hey Eric:

Here is what I did:

(i) I took a look at the channel 1 image… it isn’t phase contrast but regular brightfield. All the constants are optimized for phase contrast. Therefore I had to fake it with your data. I loaded the image up and took the complement and to avoid trouble I thresholded to reduce the signal from the bubbles

im = imread( ‘180731a_tube0_xy1c1.TIF' ); clf imshow( im, [] ) imshow( ag(-double(im),-2500,-1500) ) im_tmp = ( ag(-double(im),-2500,-1500) ); imwrite( '180731a_tube0_xy1c1.tif', im_tmp )

(ii) Then I made the extensions have the correct case:

!mv 180731a_tube0_xy1c2.TIF 180731a_tube0_xy1c2.tif !mv 180731a_tube0_xy1c3.TIF 180731a_tube0_xy1c3.tif

(iii) Now I ran SS.

cd .. processExpPAW( 'new' );

(iv) This is what it looks like in the viewer:

I’ll take a look at why it is throwing the error. The naming thing is a bit of a pain since unix vs windows vs mac handle case a bit differently.

—PAW

On Aug 2, 2018, at 7:08 PM, ejliaw notifications@github.com wrote:

Hi Prof. Wiggins,

These images reproduce the error. I pulled SuperSegger from git yesterday. I'm running MATLAB R2017a on a 64-bit computer.

SuperSeggerIssue19.zip https://github.com/wiggins-lab/SuperSegger/files/2255721/SuperSeggerIssue19.zip Thanks, Eric

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wiggins-lab/SuperSegger/issues/19#issuecomment-410122478, or mute the thread https://github.com/notifications/unsubscribe-auth/Amb9oYdm0kpZO5Nxg-pjUqne6pHopmjDks5uM7CbgaJpZM4VrqGi.

pawiggins commented 6 years ago

Also… my SS worked when I did this. (Although it didn’t find cells as explained in the previous mail.) Are you on unix, mac or windows?

—PAW

On Aug 1, 2018, at 10:34 PM, ejliaw notifications@github.com wrote:

Hello,

I'm a new user. I'd like to use SuperSegger to segment E. coli and quantify fluorescence, but on snapshots that are not part of a time-lapse series. I ran into the error below during segmentation (after <1 s). Perhaps I am not using SuperSegger as intended? Or did I trigger an edge case? Either way, I figured it might be helpful for you to know what rookie users will try to do, in case you want to build in informative error messages.

I opened up superSeggerGui, chose '60XEc', flagged 'Fluorescence Statistics' and 'Verbose', start step '1' end step '2' (or '10'), Foci '0, 0', Minimum Cell Age '0'. All other options were left as defaults. In the directory are 15 TIFF files named [basename]_xy[1 to 5]c[1 to 3].tif (or .TIF).

Here's info on one of the files, if it helps. I can also send you the images. Title: 180731a_tube0_xy5c1.tif Width: 1344 pixels Height: 1024 pixels Size: 2.6MB Bits per pixel: 16 (unsigned) Display range: 1201 - 5054 (These are the minimum and maximum values seen when I use imread() ).

Thanks for you help, Eric

trackOptiAlignPad : Image name: /pathToDirectoryLaLaLa/condition1/180731a_tube0_xy5c1.TIF Subscripted assignment dimension mismatch.

Error in dftregistration (line 93) CC(m+1-fix(m/2):m+1+fix((m-1)/2),n+1-fix(n/2):n+1+fix((n-1)/2)) = ...

Error in intAlignIm (line 45) out = dftregistration(fftA,fftB,precision);

Error in trackOptiAlignPad>intFrameAlignXY (line 200) [out,errNum,focusNum] = intAlignIm(im, phaseBef, precision );

Error in parallel_function (line 478) consume(base, limit, F(base, limit, supply(base, limit)));

Error in trackOptiAlignPad (line 114) parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142) crop_boxarray = trackOptiAlignPad( dirname,...

Error in superSeggerGui>segment_images_Callback (line 213) BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in superSeggerGui (line 38) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject)) Error using isFocus (line 33) Index exceeds matrix dimensions.

Error in intAlignIm (line 56) focusNum = isFocus( fftA );

Error in trackOptiAlignPad>intFrameAlignXY (line 200) [out,errNum,focusNum] = intAlignIm(im, phaseBef, precision );

Error in trackOptiAlignPad (line 114) parfor(jj=1:num_xy, workers)

Error in BatchSuperSeggerOpti (line 142) crop_boxarray = trackOptiAlignPad( dirname,...

Error in superSeggerGui>segment_images_Callback (line 213) BatchSuperSeggerOpti(dirname, skip, clean_flag, CONST, startEnd);

Error in gui_mainfcn (line 95) feval(varargin{:});

Error in superSeggerGui (line 38) gui_mainfcn(gui_State, varargin{:});

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)superSeggerGui('segment_images_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wiggins-lab/SuperSegger/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/Amb9odx3-JxvxTyP4IBASyw0caAZ0Hiiks5uMo9ngaJpZM4VrqGi.

ejliaw commented 6 years ago

I'm running Mac OS 10.13.6 (High Sierra). I also don't see an image in the above post, where I presume you inserted a screenshot of the viewer window.

Yes, the channel 1 images were just bright field (and slightly out of focus), and there are fluorescent beads as well as cells in the frame. I had tried adding adding 't0' before the 'xy...' portion of the name, but the same error occurred. I also have access to all 6 required/recommended MathWorks Toolboxes.

ejliaw commented 6 years ago

What is processExpPAW()? Is it your custom function?

ejliaw commented 6 years ago

After using imwrite, I am able to run SS! So perhaps there is something about my original TIFF file format that is unexpected. The images came from a Leica DMI6000B microscope running MetaMorph 7.7.6.0. I also noticed that the im_tmp written above is 8-bit as opposed to 16-bit.

ejliaw commented 6 years ago

Forgot that the TIFF files were then opened in Fiji (ImageJ Version 2.0.0-rc-68/1.52e, Build: bad6864e55) to subtract background dust, then exported using 'Save As'.

pawiggins commented 6 years ago

Hey Eric:

Ok… I ran this on my mac and had an error. This is a case (i.e. upper versus lower case) problem in the file naming. I changed intImRead.m to throw an error when it can’t find the file, rather than just returning an empty matrix which then causes a confusing error upstream.

—PAW

On Aug 3, 2018, at 4:39 PM, ejliaw notifications@github.com wrote:

Forgot that the TIFF files were then opened in Fiji (ImageJ Version 2.0.0-rc-68/1.52e, Build: bad6864e55) to subtract background dust, then exported using 'Save As'.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wiggins-lab/SuperSegger/issues/19#issuecomment-410402193, or mute the thread https://github.com/notifications/unsubscribe-auth/Amb9oac6ENQ7yd_P47B1CbXTbznoaAWvks5uNN8jgaJpZM4VrqGi.