[vtkusers] Re ad *.ics image header (Python)

Alexander Richter Alexander.Richter at student.fh-kiel.de
Wed Dec 2 09:19:06 EST 2009


Hi Jerome,

sorry for answering that late. I wrote my own class which inherits from
vtkImageReader2. First I am parsing the *.ics-file with all its parameters.
In the parsing method itself I define some things, like:

   self.SetFileName(values[1]+".ids")
   self.SetFileDimensionality(3)
   self.SetDataExtent(...)
   self.SetDataScalarTypeToUnsignedInt()
   self.SetDataByteOrderToLittleEndian()

After defining I am trying to update the whole thing with reader.Update()
but there are some errors I don't understand. The vtkOutputWindow says: 

   Warning: In ..\..\Source VTK\IO\vtkImageReader2.cxx, line 711
   vtkImageReader2 (010BE448): File operation failed.

   Generic Warning: In ..\..\Source VTK\IO\vtkImageReader2.cxx, line 781
   File operation failed. row = 0, Read = 2048, FilePos = -1

It looks like there are some problems in the beginning of reading but I
can't interprete the meaning of it because of it's short description. 

When I print out the reader object afterwards, it says:

  vtkImageReader2 (010BE448)
   Debug: Off
   Modified Time: 4889
   Reference Count: 2
   Registered Events: (none)
   Executive: 010BEF10
   ErrorCode: No error
   Information: 010BE590
   AbortExecute: Off
   Progress: 1
   Progress Text: (None)
   FileName: liver-orig001.ids
   FileNames: 00000000
   FilePrefix: (none)
   FilePattern: %s.%d
   FileNameSliceOffset: 0
   FileNameSliceSpacing: 1
   DataScalarType: int
   NumberOfScalarComponents: 1
   File Dimensionality: 3
   File Lower Left: Off
   Swap Bytes: Off
   DataIncrements: (4, 2048)
   DataExtent: (0, 511, 0, 511, 0, 182)
   DataSpacing: (1, 1, 1)
   DataOrigin: (0, 0, 0)
   HeaderSize: 0
   Internal File Name: liver-orig001.ids


Does anyone know how to solve the problem ?
By the way - thanks for offering the *.cxx-classes. How difficult is it the
embedd into the program ?

Best regards,
Alex


Jérôme-2 wrote:
> 
> Hi,
> 
> The ics header gives you the information for a basic RAW reader:
> - Extent,
> - Spacing
> - Orientation
> - ...
> 
> In Python you can parse the ics header, set a vtkImageReader with the
> parameters and set the filename to blabla.ids
> 
> I can send cxx classes that you should be able to wrap in python. These
> classes implement a vtkICSImageReader
> 
> Best regards,
> Jerome
> 

-- 
View this message in context: http://old.nabble.com/Read-*.ics-image-header-%28Python%29-tp26196866p26609269.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list