NRRD¶
NRRD format write utilities.
- io.NRRD.bitmap2nrrd(filename, bitmap, bb, options)¶
BITMAP2NRRD - Save bitmap matrix to NRRD format.
- Syntax:
io.NRRD.bitmap2nrrd(filename, bitmap, bb, options)
Format description: http://teem.sourceforge.net/nrrd/format.html
- Input Arguments:
filename - filename for NRRD
bitmap - a dataset, [height, width, colors, depth]
bb - bounding box information, a vector [minX, maxX, minY, maxY, minZ, maxZ]
options - (optional) struct with fields:
overwrite- [logical] iftruedo not check whether file with provided filename already exists; default:falseshowWaitbar- [logical] iftrueshow the progress bar, iffalsedo not show; default:trueParentFigure- (optional) handle to the main MIB application window. When provided, the progress bar is rendered asuiprogressdlgattached to that window (recommended for GUI use). When absent or empty the legacywaitbaris used as a fallback
- Output Arguments:
result -
1= success,0= failure
Example 1 - standalone / scripted use (no GUI parent):
bb = dataset.image.boundingBox; % [xmin xmax ymin ymax zmin zmax] opts.overwrite = 1; opts.showWaitbar = false; io.NRRD.bitmap2nrrd('/output/volume.nrrd', imgData_hwd, bb, opts);Example 2 - GUI use (attach progress dialog to the MIB window):
bb = dataset.image.boundingBox; opts.overwrite = 1; opts.showWaitbar = true; opts.ParentFigure = obj.mibModel.mibGUI; % uiprogressdlg parent io.NRRD.bitmap2nrrd('/output/volume.nrrd', imgData_hwd, bb, opts);