package io
- Alphabetic
- Public
- Protected
Type Members
- class FastReadOnlyNiftiVolume extends AnyRef
This class implements a subset of the niftijio.NiftyVolume functionality, maintaining almost complete compatibility in terms of field and method names, except where alternative implementations yield a significant performance gain.
This class implements a subset of the niftijio.NiftyVolume functionality, maintaining almost complete compatibility in terms of field and method names, except where alternative implementations yield a significant performance gain. This affects the following two method usages:
1. o.header.sform_to_mat44().flatten -> n.header.sformArray 2. for (d <- 0 until dim; k <- 0 until nz; j <- 0 until ny; i <- 0 until nx) yield o.data(i)(j)(k)(d) -> n.dataAsScalarArray
This class is optimized to massively outperform the original implementation when reading .nii files, however it only supports the functionality that is absolutely required for our use case (meaning that, for instance, not all header fields are accessible, only the ones that we actually use. If we need to evaluate more header fields in the future, this class will need to be extended accordingly).
This implementation only supports files < 2GB.
For more information about the file format, see http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h , http://brainder.org/2012/09/23/the-nifti-file-format/ , and the niftijio.NiftiVolume and niftijio.NiftiHeader classes
- class HDF5File extends Closeable
- trait HDF5Read[A] extends AnyRef
- trait HDF5ReadWrite[A] extends HDF5Read[A] with HDF5Write[A]
Typeclasses for reading, writing to hdf5 file
- trait HDF5Write[A] extends AnyRef
- case class NDArray[T](dims: IndexedSeq[Long], data: Array[T]) extends Product with Serializable
- trait StatismoDomainIO[D, DDomain[D] <: DiscreteDomain[D]] extends AnyRef
IO handling of PointDistributionModels with different point connectivity
IO handling of PointDistributionModels with different point connectivity
- D
: Domain dimensionality
- DDomain
: DiscretePointDomain
Value Members
- object ActiveShapeModelIO
- object FastReadOnlyNiftiVolume
- object HDF5Utils
- object ImageIO
Implements methods for reading and writing D-dimensional images
Implements methods for reading and writing D-dimensional images
WARNING! WE ARE USING an LPS WORLD COORDINATE SYSTEM
VTK file format does not indicate the orientation of the image. Therefore, when reading from VTK, we assume that it is in RAI orientation. Hence, no magic is done, the same information (coordinates) present in the VTK file header are directly mapped to our coordinate system.
This is also the case when writing VTK. Our image domain information (origin, spacing ..) is mapped directly into the written VTK file header.
This is however not the case for Nifti files! Nifti file headers contain an affine transform from the ijk image coordinates to an RAS World Coordinate System (therefore supporting different image orientations). In order to read Nifti files coherently, we need to adapt the obtained RAS coordinates to our LPS system :
This is done by mirroring the first two dimensions of each point after applying the affine transform
The same mirroring is done again when writing an image to the Nifti format.
Important for oblique images : The Nifti standard supports oblique images, that is images with a bounding box rotated compared to the world dimensions. Scalismo does not support such images. For such images, we offer the user a possibility to resample the image to a domain aligned with the world dimensions and with an RAI orientation. The integrity of the oblique image will be contained in the resampled one. This functionality can be activated by setting a flag appropriately in the scalismo.io.ImageIO.read3DScalarImage method.
Note on Nifti's qform and sform :
As mentioned above, the Nifti header contains a transform from the unit ijk grid to the RAS world coordinates of the grid. This transform can be encoded in 2 entries of the Nifti header, the qform and the sform. In some files, these 2 entries can both be present, and in some cases could even indicate different transforms. In Scalismo, when such a case happens, we favour the sform entry by default. If you wish instead to favour the qform transform, you can do so by setting a flag appropriately in the scalismo.io.ImageIO.read3DScalarImage method.
Documentation on orientation :
http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm
http://www.slicer.org/slicerWiki/index.php/Coordinate_systems
http://brainder.org/2012/09/23/the-nifti-file-format/
- object LandmarkIO
- object MeshIO
- object StatismoDomainIO
- object StatismoIO
- object StatisticalModelIO