[vtkusers] resending vtkImageReader2 DataSpacing problem

Katherine Kerekes kerekes at fastmail.fm
Fri Apr 30 11:29:36 EDT 2004


I set up my vtkImageReader2 in Tcl/Tk like this:
 
vtkImageReader2 reader
            reader SetDataSpacing $lengthXvoxel $lengthYvoxel
$lengthZvoxel
            reader SetDataExtent 0 [expr $Xdim-1] 0 [expr $Ydim-1]
$Zstart $Zend
            
            if {$dataType=="short"} {
                        reader SetDataScalarTypeToShort
            } else {
                        reader SetDataScalarTypeToFloat
            }
            reader SetDataByteOrderToLittleEndian
            reader SetFilePrefix $dataDir 
            reader SetFilePattern $filepattern
 
            reader SetProgressMethod {set progress [reader
GetProgress];setProgress $progress \
                                                            "Loading
Files:  [expr $progress*100]%"; update}
            reader Update
 
Then when I pass the reader to a vtkImageReslice no matter what I input
for the DataSpacing in the reader, the Reslice object it thinks the
DataSpacing is {1e038 1e038 1e038}.
 
Why does the data spacing not get passed along?  I saw another email
where someone suggested using vtkImageReslice to reset the DataSpacing.
I can do this and it works, but I don't understand why setting the
spacing in the reader shouldn't work.  If the ImageReader doesn't pass
the data that it has along to the next filter then the method shouldn't
be there.  Maybe I am just misusing the class?  Any help would be
appreciated.
 
Thanks,
Kate Kerekes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040430/1e64e487/attachment.htm>


More information about the vtkusers mailing list