1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
|
Usage
vtkImageReader2 is the parent class for vtkImageReader. It
is a good super class for streaming readers that do not
require a mask or transform on the data. vtkImageReader was
implemented before vtkImageReader2, vtkImageReader2 is
intended to have a simpler interface.
To create an instance of class vtkImageReader2, simply
invoke its constructor as follows
obj = vtkImageReader2
Methods
The class vtkImageReader2 has several methods that can be
used. They are listed below. Note that the documentation is
translated automatically from the VTK sources, and may not
be completely intelligible. When in doubt, consult the VTK
website. In the methods listed below, obj is an instance of
the vtkImageReader2 class.
* string = obj.GetClassName ()
* int = obj.IsA (string name)
* vtkImageReader2 = obj.NewInstance ()
* vtkImageReader2 = obj.SafeDownCast (vtkObject o)
* obj.SetFileName (string ) - Specify file name for the
image file. If the data is stored in multiple files, then
use SetFileNames or SetFilePrefix instead.
* string = obj.GetFileName () - Specify file name for the
image file. If the data is stored in multiple files, then
use SetFileNames or SetFilePrefix instead.
* obj.SetFileNames (vtkStringArray ) - Specify a list of
file names. Each file must be a single slice, and each
slice must be of the same size. The files must be in the
correct order. Use SetFileName when reading a volume
(multiple slice), since DataExtent will be modified after
a SetFileNames call.
* vtkStringArray = obj.GetFileNames () - Specify a list of
file names. Each file must be a single slice, and each
slice must be of the same size. The files must be in the
correct order. Use SetFileName when reading a volume
(multiple slice), since DataExtent will be modified after
a SetFileNames call.
* obj.SetFilePrefix (string ) - Specify file prefix for the
image file or files. This can be used in place of
SetFileName or SetFileNames if the filenames follow a
specific naming pattern, but you must explicitly set the
DataExtent so that the reader will know what range of
slices to load.
* string = obj.GetFilePrefix () - Specify file prefix for
the image file or files. This can be used in place of
SetFileName or SetFileNames if the filenames follow a
specific naming pattern, but you must explicitly set the
DataExtent so that the reader will know what range of
slices to load.
* obj.SetFilePattern (string ) - The sprintf-style format
string used to build filename from FilePrefix and slice
number.
* string = obj.GetFilePattern () - The sprintf-style format
string used to build filename from FilePrefix and slice
number.
* obj.SetDataScalarType (int type) - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToFloat () - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToDouble () - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToInt () - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToUnsignedInt () - Set the data type
of pixels in the file. If you want the output scalar type
to have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToShort () - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToUnsignedShort () - Set the data
type of pixels in the file. If you want the output scalar
type to have a different value, set it after this method
is called.
* obj.SetDataScalarTypeToChar () - Set the data type of
pixels in the file. If you want the output scalar type to
have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToSignedChar () - Set the data type
of pixels in the file. If you want the output scalar type
to have a different value, set it after this method is
called.
* obj.SetDataScalarTypeToUnsignedChar () - Get the file
format. Pixels are this type in the file.
* int = obj.GetDataScalarType () - Get the file format.
Pixels are this type in the file.
* obj.SetNumberOfScalarComponents (int ) - Set/Get the
number of scalar components
* int = obj.GetNumberOfScalarComponents () - Set/Get the
number of scalar components
* obj.SetDataExtent (int , int , int , int , int , int ) -
Get/Set the extent of the data on disk.
* obj.SetDataExtent (int a[6]) - Get/Set the extent of the
data on disk.
* int = obj. GetDataExtent () - Get/Set the extent of the
data on disk.
* obj.SetFileDimensionality (int ) - The number of
dimensions stored in a file. This defaults to two.
* int = obj.GetFileDimensionality () - Set/Get the spacing
of the data in the file.
* obj.SetDataSpacing (double , double , double ) - Set/Get
the spacing of the data in the file.
* obj.SetDataSpacing (double a[3]) - Set/Get the spacing of
the data in the file.
* double = obj. GetDataSpacing () - Set/Get the spacing of
the data in the file.
* obj.SetDataOrigin (double , double , double ) - Set/Get
the origin of the data (location of first pixel in the
file).
* obj.SetDataOrigin (double a[3]) - Set/Get the origin of
the data (location of first pixel in the file).
* double = obj. GetDataOrigin () - Set/Get the origin of the
data (location of first pixel in the file).
* long = obj.GetHeaderSize () - Get the size of the header
computed by this object.
* long = obj.GetHeaderSize (long slice) - Get the size of
the header computed by this object.
* obj.SetHeaderSize (long size) - If there is a tail on the
file, you want to explicitly set the header size.
* obj.SetDataByteOrderToBigEndian () - These methods should
be used instead of the SwapBytes methods. They indicate
the byte ordering of the file you are trying to read in.
These methods will then either swap or not swap the bytes
depending on the byte ordering of the machine it is being
run on. For example, reading in a BigEndian file on a
BigEndian machine will result in no swapping. Trying to
read the same file on a LittleEndian machine will result
in swapping. As a quick note most UNIX machines are
BigEndian while PC's and VAX tend to be LittleEndian. So
if the file you are reading in was generated on a VAX or
PC, SetDataByteOrderToLittleEndian otherwise
SetDataByteOrderToBigEndian.
* obj.SetDataByteOrderToLittleEndian () - These methods
should be used instead of the SwapBytes methods. They
indicate the byte ordering of the file you are trying to
read in. These methods will then either swap or not swap
the bytes depending on the byte ordering of the machine it
is being run on. For example, reading in a BigEndian file
on a BigEndian machine will result in no swapping. Trying
to read the same file on a LittleEndian machine will
result in swapping. As a quick note most UNIX machines are
BigEndian while PC's and VAX tend to be LittleEndian. So
if the file you are reading in was generated on a VAX or
PC, SetDataByteOrderToLittleEndian otherwise
SetDataByteOrderToBigEndian.
* int = obj.GetDataByteOrder () - These methods should be
used instead of the SwapBytes methods. They indicate the
byte ordering of the file you are trying to read in. These
methods will then either swap or not swap the bytes
depending on the byte ordering of the machine it is being
run on. For example, reading in a BigEndian file on a
BigEndian machine will result in no swapping. Trying to
read the same file on a LittleEndian machine will result
in swapping. As a quick note most UNIX machines are
BigEndian while PC's and VAX tend to be LittleEndian. So
if the file you are reading in was generated on a VAX or
PC, SetDataByteOrderToLittleEndian otherwise
SetDataByteOrderToBigEndian.
* obj.SetDataByteOrder (int ) - These methods should be used
instead of the SwapBytes methods. They indicate the byte
ordering of the file you are trying to read in. These
methods will then either swap or not swap the bytes
depending on the byte ordering of the machine it is being
run on. For example, reading in a BigEndian file on a
BigEndian machine will result in no swapping. Trying to
read the same file on a LittleEndian machine will result
in swapping. As a quick note most UNIX machines are
BigEndian while PC's and VAX tend to be LittleEndian. So
if the file you are reading in was generated on a VAX or
PC, SetDataByteOrderToLittleEndian otherwise
SetDataByteOrderToBigEndian.
* string = obj.GetDataByteOrderAsString () - These methods
should be used instead of the SwapBytes methods. They
indicate the byte ordering of the file you are trying to
read in. These methods will then either swap or not swap
the bytes depending on the byte ordering of the machine it
is being run on. For example, reading in a BigEndian file
on a BigEndian machine will result in no swapping. Trying
to read the same file on a LittleEndian machine will
result in swapping. As a quick note most UNIX machines are
BigEndian while PC's and VAX tend to be LittleEndian. So
if the file you are reading in was generated on a VAX or
PC, SetDataByteOrderToLittleEndian otherwise
SetDataByteOrderToBigEndian.
* obj.SetFileNameSliceOffset (int ) - When reading files
which start at an unusual index, this can be added to the
slice number when generating the file name (default = 0)
* int = obj.GetFileNameSliceOffset () - When reading files
which start at an unusual index, this can be added to the
slice number when generating the file name (default = 0)
* obj.SetFileNameSliceSpacing (int ) - When reading files
which have regular, but non contiguous slices (eg
filename.1,filename.3,filename.5) a spacing can be
specified to skip missing files (default = 1)
* int = obj.GetFileNameSliceSpacing () - When reading files
which have regular, but non contiguous slices (eg
filename.1,filename.3,filename.5) a spacing can be
specified to skip missing files (default = 1)
* obj.SetSwapBytes (int ) - Set/Get the byte swapping to
explicitly swap the bytes of a file.
* int = obj.GetSwapBytes () - Set/Get the byte swapping to
explicitly swap the bytes of a file.
* obj.SwapBytesOn () - Set/Get the byte swapping to
explicitly swap the bytes of a file.
* obj.SwapBytesOff () - Set/Get the byte swapping to
explicitly swap the bytes of a file.
* int = obj.OpenFile ()
* obj.SeekFile (int i, int j, int k)
* obj.FileLowerLeftOn () - Set/Get whether the data comes
from the file starting in the lower left corner or upper
left corner.
* obj.FileLowerLeftOff () - Set/Get whether the data comes
from the file starting in the lower left corner or upper
left corner.
* int = obj.GetFileLowerLeft () - Set/Get whether the data
comes from the file starting in the lower left corner or
upper left corner.
* obj.SetFileLowerLeft (int ) - Set/Get whether the data
comes from the file starting in the lower left corner or
upper left corner.
* obj.ComputeInternalFileName (int slice) - Set/Get the
internal file name
* string = obj.GetInternalFileName () - Set/Get the internal
file name
* int = obj.CanReadFile (string ) - Get the file extensions
for this format. Returns a string with a space separated
list of extensions in the format .extension
* string = obj.GetFileExtensions () - Return a descriptive
name for the file format that might be useful in a GUI.
* string = obj.GetDescriptiveName () - Return a descriptive
name for the file format that might be useful in a GUI.
* FreeMat_Documentation
* Visualization_Toolkit_IO_Classes
* Generated on Thu Jul 25 2013 17:18:34 for FreeMat by
doxygen_ 1.8.1.1
|