Data Loading and Saving¶
There are two major types of data that can be loaded to Slicer: DICOM and non-DICOM.
DICOM is a widely used and sophisticated set of standards for digital radiology.
Data can be loaded from DICOM files into the scene in two steps:
- Import: add files into the application’s DICOM database, by switching to DICOM module and drag-and-dropping files to the application window
- Load: get data objects into the scene, by double-clicking on items in the DICOM browser. The DICOM browser is accessible from the toolbar using the DICOM button . More information about DICOM can be found on the Slicer wiki.
Data in the scene can be saved to DICOM files in two steps:
- Export to database: save data from the scene into the application’s DICOM database
- Export to file system: copy DICOM files from the database to a chosen folder in the file system
More details are provided in the DICOM module documentation.
Non-DICOM data, covering all types of data ranging from images (nrrd, nii.gz, …) and models (stl, ply, obj, …) to tables (csv, txt) and point lists (json).
- Loading can happen in two ways: drag&drop file on the application window, or by using the Load Data button on the toolbar .
- Saving happens with the Save Data toolbar button .
Supported Data Formats¶
Readers may support 2D, 3D, and 4D images of various types, such as scalar, vector, DWI or DTI, containing images, dose maps, displacement fields, etc.
- DICOM (.dcm, or any other): Slicer core supports reading and writing of some data types, while extensions add support for additional ones. Coordinate system: LPS (as defined by DICOM standard).
- Supported DICOM information objects:
- Slicer core: CT, MRI, PET, X-ray, some ultrasound images; secondary capture with Slicer scene (MRB) in private tag
- Quantitative Reporting extension: DICOM Segmentation objects, Structured reports
- SlicerRT extension: DICOM RT Structure Set, RT Dose, RT Plan, RT Image
- SlicerHeart extension: 2D/3D/4D ultrasound (GE, Philips, Eigen Artemis, and other)
- SlicerDMRI tractography storage
- SlicerDcm2nii diffusion weighted MR
- For a number of dMRI formats we recommend use of the DICOM to NRRD converter before loading the data into Slicer.
- Image volumes, RT structure sets, dose volumes, etc. can be exported using DICOM module’s export feature.
- Limited support for writing image volumes in DICOM format is provided by the Create DICOM Series module.
- Support of writing DICOM Segmentation Objects is provided by the Reporting extension
- Supported DICOM information objects:
- NRRD (.nrrd, .nhdr): General-purpose 2D/3D/4D file format. Coordinate system: as defined in the file header (usually LPS).
- NRRD sequence (.seq.nrrd): 4D volume
- MetaImage (.mha, .mhd): Coordinate system: LPS (AnatomicalOrientation in the file header is ignored).
- VTK (.vtk): Coordinate system: LPS. Important limitation: image axis directions cannot be stored in this file format.
- Analyze (.hdr, .img, .img.gz): Image orientation is specified ambiguously in this format, therefore its use is strongle discouraged. For brain imaging, use Nifti format instead.
- Nifti (.nii, .nii.gz): File format for brain MRI. Not well suited as a general-purpose 3D image file format (use NRRD format instead).
- Tagged image file format (.tif, .tiff): can read/write single/series of frames
- PNG (.png): can read single/series of frames, can write a single frame
- JPEG (.jpg, .jpeg): can read single/series of frames, can write a single frame
- Windows bitmap (.bmp): can read single/series of frames
- BioRad (.pic)
- Brains2 (.mask)
- GIPL (.gipl, .gipl.gz)
- LSM (.lsm)
- Scanco (.isq)
- Stimulate (.spr)
- MGH-NMR (.mgz)
- MRC Electron Density (.mrc)
- SlicerRT extension
- Vista cone beam optical scanner volume (.vff)
- DOSXYZnrc 3D dose (.3ddose)
- SlicerHeart extension: 2D/3D/4D ultrasound (GE, Philips, Eigen Artemis, and other; reading only)
- Philips 4D ultrasound: from Cartesian DICOM exported from QLab
- GE Kretz 3D ultrasound (.vol, .v01)
- Eigen Artemis 3D ultrasound
- Any 3D/4D ultrasound image and ECG signal: if the user obtains Image3dAPI plugin from the vendor (GE Voluson, Philips, Siemens, etc.)
- RawImageGuess extension
- RAW volume (.raw): requires manual setting of header parameters
- Samsung 3D ultrasound (.mvl): requires manual setting of header parameters
- SlicerIGSIO extension:
- Compressed video (.mkv, .webm)
- IGSIO sequence metafile (.igs.mha, .igs.mhd, .igs.nrrd, .seq.mha, .seq.mhd, .mha, .mhd, .mkv, .webm): image sequence with metadata, for example for storing surgical navigation and position-tracked ultrasound data
- OpenIGTLink extension:
- PLUS toolkit configuration file (.plus.xml): configuration file for real-time data acquisition from imaging and tracking devices and various sensors
Surface or volumetric meshes.
- VTK Polygonal Data (.vtk, .vtp): Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in header. Full color (RGB or RGBA) meshes can be read and written (color must be assigned as point scalar data of
unsigned chartype and 3 or 4 components). Texture image can be applied using “Texture model” module (in SlicerIGT extension).
- VTK Unstructured Grid Data (.vtk, .vtu): Volumetric mesh. Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in header.
- STereoLithography (.stl): Format most commonly used for 3D printing. Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in header.
- Wavefront OBJ (.obj): Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in header. Texture image can be applied using “Texture model” module (in SlicerIGT extension).
- Stanford Triangle Format (.ply): Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in header. Full color (RGB or RGBA) meshes can be read and written (color must be assigned to vertex data in
uchartype properties named
blue, and optional
alpha). Texture image can be applied using “Texture model” module (in SlicerIGT extension).
- BYU (.byu, .g; reading only): Coordinate system: LPS.
- UCD (.ucd; reading only): Coordinate system: LPS.
- ITK meta (.meta; reading only): Coordinate system: LPS.
- FreeSurfer extension:
- Freesurfer surfaces (.orig, .inflated, .sphere, .white, .smoothwm, .pial; reading only)
- [SlicerHeart extension](https://github.com/SlicerHeart/SlicerHeart:
- CARTO surface model (.vtk; writing only): special .vtk polydata file format variant, which contains patient name and ID to allow import into CARTO cardiac electrophysiology mapping systems
- Segmentation labelmap representation (.seg.nrrd, .nrrd, .seg.nhdr, .nhdr, .nii, .nii.gz, .hdr): 3D volume (4D volume if there are overlapping segments) with custom fields specifying segment names, terminology, colors, etc.
- Segmentation closed surface representation (.vtm): saved as VTK multiblock data set, contains custom fields specifying segment names, terminology, colors, etc.
- Labelmap volume (.nrrd, .nhdr, .nii, .nii.gz, .hdr): segment names can be defined by using a color table. To write segmentation in NIFTI formats, use Export to file feature or export the segmentation node to labelmap volume.
- Closed surface (.stl, .obj): Single segment can be read from each file. Segmentation module’s
Export to filesfeature can be used to export directly to these formats.
- SlicerOpenAnatomy extension:
- GL Transmission Format (.glTF, writing only)
- ITK HDF transform (.h5): For linear, b-spline, grid (displacement field), thin-plate spline, and composite transforms. Coordinate system: LPS.
- ITK TXT transform (.tfm, .txt): For linear, b-spline, and thin-plate spline, and composite transforms. Coordinate system: LPS.
- Matlab MAT file (.mat): For linear and b-spline transforms. Coordinate system: LPS.
- Displacement field (.nrrd, .nhdr, .mha, .mhd, .nii, .nii.gz): For storing grid transform as a vector image, each voxel containing displacement vector. Coordinate system: LPS.
- SlicerRT extension
- Pinnacle DVF (.dvf)
- Markups JSON (.mkp.json): fiducial list, line, curve, closed curve, plane, etc. Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in image header. JSON schema is available here.
- Markups CSV (.fcsv): fiducial list points legacy file format. Default coordinate system: LPS. Coordinate system (LPS/RAS) can be specified in image header.
- Annotation CSV (.acsv): annotation ruler, ROI
- MRML (Medical Reality Markup Language File) (.mrml): MRML file is a xml-formatted text file with scene metadata and pointers to externally stored data files. See MRML overview. Coordinate system: RAS.
- MRB (Medical Reality Bundle) (.mrb, .zip): MRB is a binary format encapsulating all scene data (bulk data and metadata). Internally it uses zip format. Any .zip file that contains a self-contained data tree including a .mrml file can be opened. Coordinate system: RAS. Note: only .mrb file extension can be chosen for writing, but after that the file can be manually renamed to .zip if you need access to internal data.
- Data collections in XNAT Catalog format (.xcat; reading only)
- Data collections in XNAT Archive format (.xar; reading only)
What if your data is not supported?¶
If any of the above listed file formats cannot be loaded then report the issue on the Slicer forum.
If you have a file of binary data and you know the data is uncompressed and you know the way it is laid out in memory, then one way to load it in Slicer is to create a .nhdr file that points to the binary file. RawImageGuess extension can be used to explore an unknown data set, determining unknown loading parameters, and generate header file.
You can also ask about support for a particular file format on the Slicer forum. There may be extensions or scripts that can read or write additional formats (any Python package can be installed and used for data import/export).