SbImageDataAdapterHelperGetAppropriateAdapter Method (String, UInt64) |
Loads data and returns a preconfigured OIV.ImageViz.Nodes.Images.SoImageDataAdapter instance based on the given filename extension.
Namespace: OIV.ImageViz
public static SoImageDataAdapter GetAppropriateAdapter( string filename, ulong maxMemory )
File (or directory) to load
If the data is smaller than the specified maximum memory in MB (default 500 MB), OIV.ImageViz.SbImageDataAdapterHelper.GetAppropriateAdapter(System.String, System.UInt64) will load the data in memory and return an OIV.ImageViz.Nodes.Images.SoMemoryDataAdapter. Otherwise, data is not loaded in memory and an OIV.ImageViz.Nodes.Images.SoFileDataAdapter is returned. Access to data will be faster using a memory than a file based adapter.
If no OIV.ImageViz.Nodes.Images.SoImageDataAdapter is available for this extension or an error occurs, then NULL is returned. Returns: If possible (depending on memory limit), returns an OIV.ImageViz.Nodes.Images.SoMemoryDataAdapter object. If this is not possible, returns an OIV.ImageViz.Nodes.Images.SoFileDataAdapter for simple image formats like JPEG or an OIV.LDM.Readers.SoVolumeReader for complex formats like DICOM (note that this requires initializing the VolumeViz extension!).
Important:
'filename' should be a valid filename or pattern.
A volume dataset can be loaded using a pattern like a simple regular expression. e.g.: "/dataset/motor3d/motor_*.jpg"). This implies all images in the generated list should be a part of the same volume.
The file extension is mandatory except for a DICOM directory. Therefore "/dataset/motor3d/*.jpg" is valid but "/dataset/motor3d/*" or "/dataset/motor3d/*.*" isn't.
Special case for DICOM: "/dataset/head3d/*" is valid, but only if it's a valid DICOM directory and the generated files contain only DICOM parts of the volume.
When accessing to an LDM file the maxMemory parameter is ignored. The data is systematically loaded in memory and an OIV.ImageViz.Nodes.Images.SoMemoryDataAdapter is returned.
If 'maxMemory' is not set, the value of the environment variable IMAGEVIZ_MAX_MEMORY_ADAPTER is used, which is set to 500 MB by default.
The following file formats are supported without additional license:
BMP (Windows only), DDS, GIF, JPEG 2000, JPEG, PGX, PNG, PNM, SGI RGBA, Sun, TIFF
The table below shows file formats which are supported in combination with a VolumeViz license:
File extension | Reader class | Description |
.am | OIV.VolumeViz.Readers.SoVRAmFileReader | Avizo Mesh file format |
.dc3, .dic, .dicom | OIV.VolumeViz.Readers.SoVRDicomFileReader | DICOM file format |
.fld | OIV.VolumeViz.Readers.SoVRAvsFileReader | AVS field file format |
.lda or .ldm | OIV.LDM.Readers.SoVRLdmFileReader | LDM file format |
.sgy or .segy | OIV.VolumeViz.Readers.SoVRSegyFileReader | SEG Y rev 1 file format |
.vol | OIV.VolumeViz.Readers.SoVRVolFileReader | Vol file format |
.vox | OIV.VolumeViz.Readers.SoVRVoxFileReader | Vox file format |
.lst | OIV.VolumeViz.Readers.SoVRRasterStackReader | Lst file format (stack of images) |
File format notes:
Avizo mesh Avizo mesh is a general purpose file format that can contain many different kinds of data. The VolumeViz file reader can load Avizo mesh files containing a 3-dimensional "Lattice" data object with uniform coordinates and any data type. See OIV.VolumeViz.Readers.SoVRAmFileReader for limitations.
AVS field AVS field is a general purpose file format that can contain many different kinds of data. The VolumeViz file reader can load AVS field files containing 3-dimensional, uniform data of type "byte". See OIV.VolumeViz.Readers.SoVRAvsFileReader.
DICOM A widely used format for storing medical image data (CT, MRI, etc), defined by the National Electrical Manufacturers Association (NEMA) (medical.nema.org). See OIV.VolumeViz.Readers.SoVRDicomFileReader
LDM LDM is a format defined by VSG for storing hierarchical multi-resolution volume data. VolumeViz includes a utility program that can convert any other format supported by VolumeViz into this format (see OIV.VolumeViz.Converters.SoVolumeConverter). Preprocessing volume data into this format provides the maximum benefits from the VolumeViz large data management (LDM) features. See OIV.LDM.Readers.SoVRLdmFileReader.
SEGY A widely used format for storing seismic trace data, defined by the Society of Exploration Geophysicists publication "Digital Tape Standards" (www.seg.org). The VolumeViz reader supports all sizes of integer and float data, and can correctly determine the number of samples per trace in many cases. However the reader also has many options to adapt to differences in SEGY file headers. See OIV.VolumeViz.Readers.SoVRSegyFileReader.
VOL A simple volume interchange format (see "Introduction to Volume Rendering", Lichtenbelt, Crane, Naqvi, 1998). The VolumeViz reader can load files containing 8- or 16-bit voxels. See OIV.VolumeViz.Readers.SoVRVolFileReader.
VOX A volume interchange format defined by TeraRecon Inc. (www.terarecon.com). The VolumeViz reader can load "Vox1999a" files containing 8- or 16-bit voxels (first volume only). See SOVRVoxFileReader.
LST (stack of images) A simple format for loading a stack of images (one image per file). Specify the names of the image files in a .lst file. VolumeViz can load image data in most common image formats including BMP, DDS, GIF, JPEG, JPEG2000, PNG and TIFF. See OIV.VolumeViz.Readers.SoVRRasterStackReader for details and limitations.
Note: '3D TIFF' files (multiple images in one file) are not currently supported.