ImageSave
-
MLModule
genre |
FileMain |
authors |
Tobias Boskamp, Dirk Selle |
package |
MeVisLab/Standard |
dll |
MLImageFile |
definition |
mlImageFile.def |
see also |
ImageLoad, OpenImage, SaveImage, MakeName, DicomTagViewer, DicomTagModify, SaveBase |
keywords |
Store, File, Format, TIFF, DICOM, Analyze, Raw, PNM, PGM, PPM, JPEG, JPG, PNG, BMP |
Purpose
The module ImageSave saves an image to a file using one of the following image file formats:
- DICOM
- TIFF
- DICOM/TIFF
- RAW
- LUMISYS
- PNM
- Analyze
- PNG
- JPEG
Usage
In order to save an image to a file, specify the Filename (click the Browse button to select the output file using a save file dialog), the Format, enter an optional image Comment and click the Save button. The Status field indicates whether the image could be successfully stored. In case of an error, more detailed information is printed to the MeVisLab console. The filename extension of the output file is always chosen according to the selected file format (e.g. .dcm for DICOM files and .tif for TIFF files).
If the original source image is read from a DICOM file or a DICOM/TIFF pair, the Source name is filled in automatically. For other input formats, the Source Name field can be connected to the Filename field of the ImageLoad module.
NOTE that ImageSave does not create a directory on its own; make sure that the directory in which you want to save a file in already exists.
Details
The following image file formats are supported:
Format |
Description |
DICOM |
Generates uncompressed 2D and 3D (single file) DICOM files. |
TIFF |
Generates uncompressed 2D and 3D TIFF files. |
DICOM/TIFF |
See explanation below. |
RAW |
Generates raw binary data files with little endian byte order. |
PNM |
Generates 2D PNM, PGM or PPM files. |
Analyze |
Generates Analyze 7.5 files, consisting of a header file (*.hdr)
and a raw binary data file (*.img). This format supports 2D, 3D and 4D images. |
PNG |
The Portable Network Graphics (PNG) format supports 2D gray and RGB images up
to 16 bit per sample, with or without alpha channel, with or without lossless
compression. |
JPEG |
The wide-spread JPEG standard supports 8-bit 2D gray and RGB images with lossy
compression. Lossless compression, 12-bit and JPEG-2000 are not supported. |
BMP |
The wide-spread Windows bitmap format supports 8-bit 2D RGB and palette images.
Compressed BMP images are not supported. |
Windows
Default Panel
Parameter Fields
Main Panel
The main panel provides the following elements:
Auto Filename section
In some cases it is desirable to automatically derive the output filename and location from the input filename used for reading the original source image (using the ImageLoad module at some other place in a MeVisLab network). This can be done using the fields in the Auto Filename section. When the Enable automatic filename checkbox is selected, the output filename is generated by removing the source name's file extension, appending the string given in the Postfix field, and adding the appropriate file extension for the selected file format. If the original source image is read from a DICOM file or a DICOM/TIFF pair, the Source Name is filled in automatically. For other input formats, the Source Name can be connected from the Filename field of the ImageLoad module.
Options Panel
The Options panel shows additional options for the selected file format. The options shown depend on the currently selected format.
Visible Fields
Save In Background
-
name: startTask, type: Trigger
If pressed, the image file is being save in the backgroung.
This enables the user to interact with the GUI while the image is being saved.
Cancel
-
name: cancelTask, type: Trigger
If pressed, the saving of an image in the background is being canceled.
Status
-
name: status, type: String, persistent: no
Shows whether the image could successfully be stored.
In case of an error, more detailed information is printed to the MeVisLab console.
Filename
-
name: filename, type: String
Sets the file path to which the image is saved.
Click the Browse button to select a file path using a standard file dialog.
Save
-
name: save, type: Trigger
If pressed, the image is being saved.
Allow Overwrite
-
name: allowOverwrite, type: Bool, default: TRUE
If checked, an existing file is overwritten without requesting permission.
Enable automatic filename
-
name: autoFilename, type: Bool, default: FALSE, deprecated name: appendToFilename
If checked, the file name is generated out of the input image's file name.
Source Name
-
name: sourceName, type: String, deprecated name: inputFilename
Shows and sets the source file name.
This name is used for the automatic generation of the file name.
Postfix
-
name: postfix, type: String, default: .result1
Sets a postfix that is used for the automatic generation of the file name.
Derived/secondary image
-
name: dicomDerived, type: Bool, default: TRUE
If checked, certain DICOM tags in the target file are modified in order to indicate a so-called "derived" or "secondary" image.
This can be for example an image that has been obtained from an original image by some image processing (e.g. an MR image to which an image sharpening has been applied).
Store Time Info
-
name: dicomStoreTimeInfo, type: Enum, default: None
Defines whether the DICOM acquisition time and/or the DICOM content time are set to the time information available for the input image.
- Notes on storing the time info:
- The DICOM acquisition and content time tags can only store a single time value. For MeVisLab images with more than one time point (4D data), the value for the first time point is stored. Thus, this option makes most sense for 2D or 3D data.
- Regardless of the Store Time Info setting, the complete time points information is always stored in private DICOM tags, provided that the Discard Tags option is not set to All Private.
Values:
Title |
Name |
Description |
None |
None |
Time info is not stored in any of the standard DICOM tags (default). |
Acquisition Time |
Acquisition |
Time info is stored in the DICOM tags Acquisition Date, Acquisition Time, and Acquisition Datetime. |
Content Time |
Content |
Time info is stored in the DICOM tags Content Date and Content Datetime. |
Acquisition & Content Time |
AcquisitionContent |
Time info is stored in both the acquistion and the content time tags. |
Set window
-
name: dicomSetWindow, type: Bool, default: FALSE
If checked, the fields Center and Width specify the viewing window parameters stored in the DICOM file.
Otherwise these values are copied from the source image (if it contains corresponding DICOM tags).
Center
-
name: dicomWindowCenter, type: Integer, default: 0
Sets the center value for the Dicom windowing.
Width
-
name: dicomWindowWidth, type: Integer, default: 0
Sets the width value for the Dicom windowing.
Compression (tiffCompression)
-
name: tiffCompression, type: Enum, default: None
Defines the lossless compression method used for storing the image data in TIFF format.
Values:
Title |
Name |
Description |
None |
None |
No compression is used. |
Packbits |
Packbits |
The packbits algorithm is used for image data compression. |
LZW |
LZW |
The LZW algorithm is used for image data compression. |
Tile Width
-
name: tiffTileX, type: Integer, default: 128
Sets the width of the image data tiles stored in the TIFF file.
If the Auto options are enabled, the tile size is selected automatically.
Tile Height
-
name: tiffTileY, type: Integer, default: 128
Sets the height of the image data tiles stored in the TIFF file.
If the Auto options are enabled, the tile size is selected automatically.
Auto (tiffTileXAuto)
-
name: tiffTileXAuto, type: Bool, default: TRUE
If checked, the width of the tiles are set automatically.
Auto (tiffTileYAuto)
-
name: tiffTileYAuto, type: Bool, default: TRUE
If checked, the height of the tiles are set automatically.
Compression (pngCompression)
-
name: pngCompression, type: Enum, default: Default
Defines the lossless compression method used for storing the image datain PNG format.
Values:
Title |
Name |
None |
None |
Fastest |
Fastest |
Best |
Best |
Default |
Default |
Interlaced
-
name: pngInterlaced, type: Bool, default: FALSE
If checked, the file is stored in interlaced mode, allowing some sort of progressive display, e.g. when viewed over slow Internet connections.
Quality
-
name: jpegQuality, type: Integer, default: 75, minimum: 0, maximum: 100
Sets the quality parameter used in the lossy compression of the image data.
Setting Quality to 100 results in the highest possible image quality and the largest file size, setting it to 0 results in the lowest possible image quality and the smallest file size.
Progressive
-
name: jpegProgressive, type: Bool, default: FALSE
If checked, the file is stored in progressive mode mode, allowing progressive display of the image, e.g. when viewed over slow Internet connections.
Hidden Fields
startTaskSynchronous
-
name: startTaskSynchronous, type: Trigger
taskFinished
-
name: taskFinished, type: Trigger
taskCanceled
-
name: taskCanceled, type: Trigger
taskRunning
-
name: taskRunning, type: Bool, persistent: no
taskVerboseLogging
-
name: taskVerboseLogging, type: Bool, default: FALSE
progress
-
name: progress, type: Float, persistent: no
dicomNameUsed
-
name: dicomNameUsed, type: Bool, default: TRUE
dicomIgnoreHalfVoxelShift
-
name: dicomIgnoreHalfVoxelShift, type: Bool, default: FALSE