[Insight-users] Tiff Image serie loading

Julien Jomier julien.jomier at kitware.com
Tue Jun 12 10:50:58 EDT 2007


Hey Nic,

Glad that you are getting the files in the correct order.
The ImageSeriesReader is trying to determine the spacing of the volume 
by looking at two consecutive slices. That is why (with the warnings) 
you think it's actually in the wrong order, because it's actually 
reading the header of the image 6 then image 5 to determine the spacing 
between slices.

Regarding reverse ordering of the slices, the itkImageSeriesReader has a 
boolean flag: SetReverseOrder(true) that should do what you want. Note 
that the FilenameGenerator doesn't support reverse ordering.

Hope that helps,

Julien

Nic wrote:
> Thx Julien,
>    I tried your code and the generated list is correct, in the correct 
> order and number of files; this is confirmed by the multidimensional 
> Tiff written, which contain all images once, in the correct order. 
> Perhaps is it only a display bug, related to my image type ?
> By the way, I have another question: I'm trying to load another image 
> stack in the REVERSE order, tried to change StartIndex and EndIndex, the 
> IncrementIndex but without success. It is possible to do it directly ? 
> Or have to get filenames in a vector like in your code and reverse order 
> in the vector and work with it then ?
> 
>> Hi Nic,
>>
>> So apparently you are using non-standard TIFF images, therefore you 
>> get the warnings and as long as you can read the images it shouldn't 
>> be a problem.
>>
>> Can you check the output of the NameGenerator to make sure it is 
>> showing the expected values?:
>>
>> std::vector<std::string> filenames = nameGenerator->GetFileNames();
>>
>> std::vector<std::string>::const_iterator it = filenames .begin();
>> while(it != filenames.end())
>>   {
>>   std::cout << (*it).c_str() << std::endl;
>>   it++;
>>   }
>>
>> Is you resulting image a stack in the wrong order?
>>
>> Julien
>>
>> Nic wrote:
>>> Hello,
>>>     I'm having a strange behaviour when trying to load two tiff image 
>>> series. I get these types of warning message:
>>>  TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-001.tif: 
>>> unknown field with tag 317 (0x13d) encountered.
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-000.tif: 
>>> invalid TIFF directory; tags are not sorted in a
>>> scending order.
>>>  Moreover, image seems not to be loaded in the incorrect order 
>>> (trying to load from image 5 to 10:
>>>  TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-006.tif: 
>>> invalid TIFF directory; tags are not sorted in ascending order.
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-006.tif: 
>>> unknown field with tag 317 (0x13d) encountered.
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-005.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-005.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-005.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-005.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-006.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-006.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-007.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-007.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-008.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-008.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-009.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-009.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-010.tif: [...]
>>> TIFFReadDirectory: Warning, 
>>> I:/Tests/synthetique-512/example-synthetique-512-recto-010.tif: [...]
>>>  I get _exactly_ the same problem with _ImageSeriesReadWrite_ 
>>> example.. For information, my tiff images files are color-indexed 
>>> tiffs, 8-bit
>>> Did someone had such warnings and behaviour.. ?
>>> N.
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
> 
> 



More information about the Insight-users mailing list