Discussion:
[ITK-users] Reader InvalidRequestedRegionError
matimont
2017-08-07 19:57:38 UTC
Permalink
Hi,

I'm reading a serie from a directory and I get this:

itk::InvalidRequestedRegionError (0000001D4B9AEDD8)
Location: "unknown"
File: c:\itk-4.12.0\modules\io\imagebase\include\itkImageFileReader.hxx
Line: 350
Description: ImageIO returns IO region that does not fully contain the
requested regionRequested region: ImageRegion (0000001D4B9AEDA0)
Dimension: 3
Index: [0, 0, 0]
Size: [512, 512, 1]
StreamableRegion region: ImageRegion (0000001D4B9AEE00)
Dimension: 3
Index: [0, 0, 0]
Size: [484, 484, 1]

I noticed the images I read have ImageOrientationPatient as:
(0020,0037) ImageOrientationPatient
-0.4181660095794\0.90837062283655\0\0\0\-1

This only patient has failed, all others work

Would this cause the reader to fail?

This is part of the code I use to read the series:

ImageIOType::Pointer gdcmIO = ImageIOType::New();
InputNamesGeneratorType::Pointer inputNames =
InputNamesGeneratorType::New();
inputNames->SetInputDirectory( argv[1] );

const ReaderType::FileNamesContainer & filenames =
inputNames->GetInputFileNames();

ReaderType::Pointer reader = ReaderType::New();

reader->SetImageIO( gdcmIO );
reader->SetFileNames( filenames );
try
{
reader->Update();
}
catch (itk::ExceptionObject &excp)
{
std::cerr << "Exception thrown while reading the series" << std::endl;
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}

Thanks,

Matias.



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Reader-InvalidRequestedRegionError-tp7590161.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
Dženan Zukić
2017-08-08 13:41:33 UTC
Permalink
Hi Matias,

can you check that all images in that series have size 512x512? A possible
cause is if one of the images has size 484x484.

Orientation and region are not connected too much, I doubt that a funky
orientation would cause problems for region.

Regards,
DÅŸenan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)
Post by matimont
Hi,
itk::InvalidRequestedRegionError (0000001D4B9AEDD8)
Location: "unknown"
File: c:\itk-4.12.0\modules\io\imagebase\include\itkImageFileReader.hxx
Line: 350
Description: ImageIO returns IO region that does not fully contain the
requested regionRequested region: ImageRegion (0000001D4B9AEDA0)
Dimension: 3
Index: [0, 0, 0]
Size: [512, 512, 1]
StreamableRegion region: ImageRegion (0000001D4B9AEE00)
Dimension: 3
Index: [0, 0, 0]
Size: [484, 484, 1]
(0020,0037) ImageOrientationPatient
-0.4181660095794\0.90837062283655\0\0\0\-1
This only patient has failed, all others work
Would this cause the reader to fail?
ImageIOType::Pointer gdcmIO = ImageIOType::New();
InputNamesGeneratorType::Pointer inputNames =
InputNamesGeneratorType::New();
inputNames->SetInputDirectory( argv[1] );
const ReaderType::FileNamesContainer & filenames =
inputNames->GetInputFileNames();
ReaderType::Pointer reader = ReaderType::New();
reader->SetImageIO( gdcmIO );
reader->SetFileNames( filenames );
try
{
reader->Update();
}
catch (itk::ExceptionObject &excp)
{
std::cerr << "Exception thrown while reading the series" << std::endl;
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
Thanks,
Matias.
--
View this message in context: http://itk-insight-users.
2283740.n2.nabble.com/Reader-InvalidRequestedRegionError-tp7590161.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.kitware.com/products/protraining.php
http://www.itk.org/Wiki/ITK_FAQ
http://public.kitware.com/mailman/listinfo/insight-users
matimont
2017-08-08 13:55:15 UTC
Permalink
That was actually the issue, there was an image in the series that was not
supposed to be there, thank you for your suggestions, it saved me time!
Matias.



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Reader-InvalidRequestedRegionError-tp7590161p7590171.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users

Loading...