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. Access to data will be faster using an OIV.ImageViz.Nodes.Images.SoMemoryDataAdapter 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 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.
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.