Git Product home page Git Product logo

Comments (29)

DylanMuir avatar DylanMuir commented on June 9, 2024

Hi,
Could you please let me know which versions of matlab you are using on both the OS X and the Windows 7 system (using version)?

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

Windows 7: 8.4.0.150421 (R2014b)
OS X: 8.5.0.197613 (R2015a) (But I have been using it under the same R2014b successfully)

But I haven't tried the commit you made 3 days ago yet.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

So I tried the latest commit on both R2014b and R2015a on Windows 7 and R2015a on Mac OS X and now it's not working on either one, but I get a different error:
( I did delete and recompile the MEX files, just to be sure, recompiling works fine)

Undefined function or variable "vnRetDataSize".

Error in TIFFStack/subsref (line 367)
if (prod(vnRetDataSize) == 0)

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Sorry for that reversion. The latest commit should fix that issue.

Could you try again please? And include the matlab command which fails on Windows 7 but not OS X?

Thanks,
Dylan.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

So the commit fixed the new error. Now it's working again on Mac but not on Windows. I tested it on another windows machine and the same error occurs.

>> ts = TIFFStack('D:\test_stack2.tif');
>> ts(1)
Error using TIFFStack>TS_read_data_Tiff (line 719)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 396)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> ts(:,:,1)
Error using TIFFStack>TS_read_data_Tiff (line 719)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 396)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> ts(:)
Error using TIFFStack>TS_read_data_Tiff (line 683)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 396)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> ts(1,1,1)
Error using TIFFStack>TS_read_data_Tiff (line 719)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 396)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Ok. Please try ts(end) and let me know.

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

What are the dimensions of your stack? (i.e. size ts)?

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

Here you go

>> size(ts)

ans =

   512   512    88

>> ts(end)
Error using TIFFStack>TS_read_data_Tiff (line 719)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 396)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Ok. Please pull the latest commit, create your stack, type diagnostic(ts), and send me the output.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024
>> ts = TIFFStack('D:\test_stack2.tif');
--- TIFFStack: Compiling MEX functions.
Building with 'Microsoft Visual C++ 2013 Professional (C)'.
MEX completed successfully.
>> diagnostic(ts)
  512x512x88 TIFFStack array with properties:

         bInvert: 0
     strFilename: 'D:\test_stack2.tif'
      sImageInfo: [88x1 struct]
    strDataClass: 'uint16'

Private properties:
   bUseTiffLib: 1
   fhReadFun: TS_read_Tiff_striped_chunky
   vnDimensionOrder: [1 2 3 4 ]
   fhRepSum: mapped_tensor_repsum
>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Please comment out lines 234 and 236, leaving line 235 in:

           % if (verLessThan('matlab', '8.3'))
              strReadFun = [strReadFun '_pre2014'];
           % end

and try again with diagnostic(ts), ts(1) and ts(end).

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024
>> ts = TIFFStack('D:\test_stack2.tif');
>> diagnostic(ts)
  512x512x88 TIFFStack array with properties:

         bInvert: 0
     strFilename: 'D:\test_stack2.tif'
      sImageInfo: [88x1 struct]
    strDataClass: 'uint16'

Private properties:
   bUseTiffLib: 1
   fhReadFun: TS_read_Tiff_striped_chunky_pre2014
   vnDimensionOrder: [1 2 3 4 ]
   fhRepSum: mapped_tensor_repsum
>> ts(1)
Error using TIFFStack>TS_read_data_Tiff (line 729)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> ts(end)
Error using TIFFStack>TS_read_data_Tiff (line 729)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack,
                  S.subs, bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Please comment out line 671 (try) and lines 688--694 (catch to end), try ts(1) and send me the error message.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

I did that but note that the error gets thrown in Line 719, so the result stays the same:

>> ts = TIFFStack('D:\test_stack2.tif');
>> diagnostic(ts)
  512x512x88 TIFFStack array with properties:

         bInvert: 0
     strFilename: 'D:\test_stack2.tif'
      sImageInfo: [88x1 struct]
    strDataClass: 'uint16'

Private properties:
   bUseTiffLib: 1
   fhReadFun: TS_read_Tiff_striped_chunky_pre2014
   vnDimensionOrder: [1 2 3 4 ]
   fhRepSum: mapped_tensor_repsum
>> ts(1)
Error using TIFFStack>TS_read_data_Tiff (line 729)
*** TIFFStack: Could not read data from image file.

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

Caused by:
    Subscripted assignment dimension mismatch.

>> 

So I did additionally comment out the try-catch statements for the block in which the error get actually thrown (712-731) and this is the result:

>> ts = TIFFStack('D:\test_stack2.tif');
>> diagnostic(ts)
  512x512x88 TIFFStack array with properties:

         bInvert: 0
     strFilename: 'D:\test_stack2.tif'
      sImageInfo: [88x1 struct]
    strDataClass: 'uint16'

Private properties:
   bUseTiffLib: 1
   fhReadFun: TS_read_Tiff_striped_chunky_pre2014
   vnDimensionOrder: [1 2 3 4 ]
   fhRepSum: mapped_tensor_repsum
>> ts(1)
Subscripted assignment dimension mismatch.

Error in TIFFStack>TS_read_Tiff_striped_chunky_pre2014 (line
933)
      tfImageBuffer(row_inds,:,:) =
      tifflib('readEncodedStrip', tlStack, stripNum);

Error in TIFFStack>TS_read_data_Tiff (line 721)
            [tfData(vbThesePixels), tfImage] =
            oStack.fhReadFun(tfImage, tlStack, spp, w, h,
            rps, tw, th,
            vnFrameLinearIndices(vbThesePixels));

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Great, thanks. Please revert lines 234 and 236 and try again.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024
>> ts = TIFFStack('D:\test_stack2.tif');
>> diagnostic(ts)
  512x512x88 TIFFStack array with properties:

         bInvert: 0
     strFilename: 'D:\test_stack2.tif'
      sImageInfo: [88x1 struct]
    strDataClass: 'uint16'

Private properties:
   bUseTiffLib: 1
   fhReadFun: TS_read_Tiff_striped_chunky
   vnDimensionOrder: [1 2 3 4 ]
   fhRepSum: mapped_tensor_repsum
>> ts(1)
Subscripted assignment dimension mismatch.

Error in TIFFStack>TS_read_Tiff_striped_chunky (line 853)
      tfImageBuffer(row_inds,:,:) =
      tifflib('readEncodedStrip', tlStack, stripNum-1);

Error in TIFFStack>TS_read_data_Tiff (line 721)
            [tfData(vbThesePixels), tfImage] =
            oStack.fhReadFun(tfImage, tlStack, spp, w, h,
            rps, tw, th,
            vnFrameLinearIndices(vbThesePixels));

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

>> 

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Please send a copy of the matlab toolbox file Tiff.m, from the Windows 7 machine, by attaching it to this issue. Or you can mail it to me if you prefer.

Thanks for your willingness to help debug!

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

Github doesn't allow attaching anything but images. I've emailed you the file. I appreciate your dedication getting this to run.

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Ok, it's seriously weird. Please run with dbstop error, and when it breaks, please send me this output:

r
rps
h
row_inds
strip_num
size(tfImageBuffer)

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024
>> ts = TIFFStack('D:\test_stack2.tif');
>> dbstop error
>> ts(1)
Subscripted assignment dimension mismatch.

Error in TIFFStack>TS_read_Tiff_striped_chunky (line 853)
      tfImageBuffer(row_inds,:,:) =
      tifflib('readEncodedStrip', tlStack, stripNum-1);

Error in TIFFStack>TS_read_data_Tiff (line 721)
            [tfData(vbThesePixels), tfImage] =
            oStack.fhReadFun(tfImage, tlStack, spp, w, h,
            rps, tw, th,
            vnFrameLinearIndices(vbThesePixels));

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

853       tfImageBuffer(row_inds,:,:) = tifflib('readEncodedStrip', tlStack, stripNum-1);
K>> save('D:\error_workspace.mat')

I have sent you the mat file per email

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

All the values look reasonable. Last thing to check is what's coming our of tifflib. Please replace line 853 with:

tfTmp = tifflib('readEncodedStrip', tlStack, stripNum-1);
tfImageBuffer(row_inds,:,:) = tfTmp;

and then please send me the workspace again.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024
>> dbstop error
>> ts = TIFFStack('D:\test_stack2.tif');
>> ts(1)
Subscripted assignment dimension mismatch.

Error in TIFFStack>TS_read_Tiff_striped_chunky (line 855)
      tfImageBuffer(row_inds,:,:) = tfTmp;

Error in TIFFStack>TS_read_data_Tiff (line 721)
            [tfData(vbThesePixels), tfImage] = oStack.fhReadFun(tfImage,
            tlStack, spp, w, h, rps, tw, th,
            vnFrameLinearIndices(vbThesePixels));

Error in TIFFStack/subsref (line 406)
                  tfData = TS_read_data_Tiff(oStack, S.subs,
                  bLinearIndexing);

855       tfImageBuffer(row_inds,:,:) = tfTmp;

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Could you please send a copy of the offending tiff file, from the windows machine?

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

I've sent you a shared link to a google drive folder containing the file.

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

This bug should now be fixed in the latest commit. Please pull the latest changes and check.

imfinfo reported a different number of rows per strip than tifflib, only on Windows. The number reported by tifflib was correct. TIFFStack now checks for this inconsistency, and uses the tifflib value.

Thanks again for helping out with debugging.

from tiffstack.

drdadr avatar drdadr commented on June 9, 2024

Thanks for your commitment to resolving my issue. Works fine now.

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Great, thanks for letting me know.

from tiffstack.

YishGene avatar YishGene commented on June 9, 2024

Hello,
I'm trying to use your TIFFStack library and getting errors like this on stacks taken on scanimage system. I can ready the first channel in the first image, but any attempt to get further than that gives me the error:

Error using TIFFStack>TS_read_data_Tiff (line 1327)
*** TIFFStack: Could not read data from image file.
Error in TIFFStack/subsref (line 685)
                  tfData = TS_read_data_Tiff(oStack, S.subs, bLinearIndexing);
Caused by:
    Subscripted assignment dimension mismatch. 

i.e. this works:

t = TIFFStack('file.tiff', [], 2); 
a = t(:, :, 1,1)

but this not:
a = t(:,:,2,1)

Thanks!
Yishai

from tiffstack.

DylanMuir avatar DylanMuir commented on June 9, 2024

Extra comment moved to new issue #26

from tiffstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.