Closed drdadr closed 9 years ago
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
)?
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.
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)
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.
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.
>>
Ok. Please try ts(end)
and let me know.
What are the dimensions of your stack? (i.e. size ts
)?
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.
>>
Ok. Please pull the latest commit, create your stack, type diagnostic(ts)
, and send me the output.
>> 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
>>
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)
.
>> 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.
>>
Please comment out line 671 (try
) and lines 688--694 (catch
to end
), try ts(1)
and send me the error message.
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);
>>
Great, thanks. Please revert lines 234 and 236 and try again.
>> 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);
>>
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!
Github doesn't allow attaching anything but images. I've emailed you the file. I appreciate your dedication getting this to run.
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)
>> 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
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.
>> 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;
Could you please send a copy of the offending tiff file, from the windows machine?
I've sent you a shared link to a google drive folder containing the file.
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.
Thanks for your commitment to resolving my issue. Works fine now.
Great, thanks for letting me know.
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
Extra comment moved to new issue #26
So I cloned it directly from GitHub and it works fine under MacOS but it won't work under Windows 7. Compiling the Mex functions works, but when I try to access data from the object it errors:
The Code and the image file is exactly the same on both machines so it's not actually an assignment mismatch or reading error. I tracked the error down to the sub function:
<TS_read_Tiff_striped_chunky>
in the call to the<tifflib>
the error occurs. Again all parameters beside the header number are the same.