View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010124ITKpublic2010-01-12 10:072010-10-21 12:31
ReporterBradley Lowekamp 
Assigned ToBradley Lowekamp 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionITK-3-18 
Summary0010124: ImageIO methods ReadBufferAsASCII and WriteBufferAsASCII do not handle signed and unsigned chars correctly
DescriptionThese methods read or write the character as a single character and not as a number. That is if a pixel has the value 48 then "0" is written instead of "48".

This is different then what is needed for the VTK file format.
Additional InformationProposed solution:
template <class TComponent>
void WriteBuffer(std::ostream& os, const TComponent *buffer, ImageIOBase::SizeType num)
{
  const TComponent *ptr = buffer;
  typedef typename itk::NumericTraits<TComponent>::PrintType PrintType;
  for (ImageIOBase::SizeType i=0; i < num; i++)
    {
    if ( !(i%6) && i )
      os << "\n";
    os << PrintType(*ptr++) << " ";
    }
}
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Files

 Relationships

  Notes
(0019605)
Bradley Lowekamp (developer)
2010-02-24 09:41

The solution was committed:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageIOBase.cxx?root=Insight&r1=1.88&r2=1.89&sortby=date [^]
(0021134)
Bradley Lowekamp (developer)
2010-06-22 15:23

The patch appears to be working and VTK file format is working correctly.

 Issue History
Date Modified Username Field Change
2010-01-12 10:07 Bradley Lowekamp New Issue
2010-01-12 10:17 Bradley Lowekamp Additional Information Updated
2010-02-24 09:35 Bradley Lowekamp Status new => assigned
2010-02-24 09:35 Bradley Lowekamp Assigned To => Bradley Lowekamp
2010-02-24 09:41 Bradley Lowekamp Note Added: 0019605
2010-06-22 15:23 Bradley Lowekamp Note Added: 0021134
2010-06-22 15:23 Bradley Lowekamp Status assigned => resolved
2010-06-22 15:23 Bradley Lowekamp Fixed in Version => ITK-3-18
2010-06-22 15:23 Bradley Lowekamp Resolution open => fixed
2010-10-21 12:31 Gabe Hart Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team