View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009260ITKpublic2009-07-11 12:032010-11-07 01:18
ReporterLuis Ibanez 
Assigned ToLuis Ibanez 
PriorityurgentSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0009260: Integer types inconsistency in 64 bits platforms
DescriptionWindows 64 bits platforms define "long" as a 32-bits integer. As a consequence, the Index, Size, and Offset types are unable to manage images larger than 2Gb.
Additional InformationThread in the users mailing list:
http://www.itk.org/pipermail/insight-users/2009-July/031463.html [^]
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Filespatch file icon MetaImage64BitsWarnings.patch [^] (47,426 bytes) 2009-11-21 13:47 [Show Content]

 Relationships
related to 0008371assignedBradley Lowekamp large MetaImage files and 32-bit produces erroneous results 

  Notes
(0016848)
Luis Ibanez (manager)
2009-07-11 12:05

verified in the following way:

http://www.itk.org/pipermail/insight-users/2009-July/031442.html [^]

#include <iostream>
#include "itkOffset.h"
#include "itkNumericTraits.h"

int main()
{
  unsigned long tt;
  std::cout << "size = " << sizeof(tt) << std::endl;
  tt = -1;
  std::cout << "tt = " << tt << std::endl;

  typedef itk::Offset<3> OffsetType;
  typedef OffsetType::OffsetValueType OffsetValueType;

  OffsetValueType offsetValue;

  std::cout << "sizeof(offsetValue) = " << sizeof( offsetValue ) <<
std::endl;

  offsetValue = itk::NumericTraits< OffsetValueType >::max();

  std::cout << "OffsetValueType max() = " << offsetValue << std::endl;

  return EXIT_SUCCESS;
}
(0016849)
Luis Ibanez (manager)
2009-07-11 13:33

In order to be consistent across platforms and across architectures we suggest that the types should be:

ptrdiff_t for OffsetValueType (this is signed)
size_t for SizeValueType (this is unsigned)
ptrdiff_t for IndexValueType (this is signed)

and that the use of "int" and "long" should be discouraged when loading values into these variables. Instead developers should use the Traits from the ImageType as


ImageType::OffsetValueType
ImageType::SizeValueType
ImageType::IndexValueType


More details in the discussion at:

http://www.itk.org/pipermail/insight-users/2009-July/031466.html [^]
(0016850)
Luis Ibanez (manager)
2009-07-12 06:56

First pass of changes committed:

Introducing Traits for IndexValueType, SizeValueType and OffsetType.

Replacing explicit use of "long" in the Tests, when refering to this concepts.

Also expanded use of SpacingValueType and PointValueType.

In general,
all these types should have always been obtained as Traits of the Image...
(0018499)
Luis Ibanez (manager)
2009-11-21 13:46

Adding patch for the MetaImage library.

Most of the changes are related to

METAIO_STL::streampos
METAIO_STL::streamoff
METAIO_STL::streamsize
(0018506)
Luis Ibanez (manager)
2009-11-21 14:34

Julien committed the patch.
Thanks !
(0022985)
Luis Ibanez (manager)
2010-11-07 01:18

This is still an issue, and requires a toolkit-wide review for correcting it.

 Issue History
Date Modified Username Field Change
2009-07-11 12:03 Luis Ibanez New Issue
2009-07-11 12:05 Luis Ibanez Note Added: 0016848
2009-07-11 12:05 Luis Ibanez Status new => confirmed
2009-07-11 12:05 Luis Ibanez Status confirmed => assigned
2009-07-11 12:05 Luis Ibanez Assigned To => Luis Ibanez
2009-07-11 12:05 Luis Ibanez Priority normal => urgent
2009-07-11 13:33 Luis Ibanez Note Added: 0016849
2009-07-12 06:56 Luis Ibanez Note Added: 0016850
2009-11-21 13:46 Luis Ibanez Note Added: 0018499
2009-11-21 13:47 Luis Ibanez File Added: MetaImage64BitsWarnings.patch
2009-11-21 14:34 Luis Ibanez Note Added: 0018506
2009-11-22 10:01 Bradley Lowekamp Relationship added related to 0008371
2010-11-07 01:18 Luis Ibanez Note Added: 0022985


Copyright © 2000 - 2018 MantisBT Team