![]() |
Microscopy Image Browser
1.233
|
class is resposnible to keep and visualize datasets More...
Public Member Functions | |
function
handles = | addColorChannel (img, handles, channelId, lutColors) |
Add a new color channel to the existing dataset. More... | |
function | clearContents (handles) |
Set all elements of the class to default values. More... | |
function | clearMask (height, width, z, t) |
Clear the Mask layer. It is also possible to specify the area where the Mask layer should be cleared. More... | |
function [
handles , status ] = | convertImage (format, handles) |
Convert image to specified format: grayscale , truecolor , indexed and uint8 , uint16 , uint32 class. More... | |
function [
x , y , z , t ] = | convertMouseToDataCoordinates (x, y, mode, permuteSw) |
Convert coordinates under the mouse cursor to the coordinates of the dataset. More... | |
function [
x , y ] = | convertDataToMouseCoordinates (x, y, mode, magFactor) |
Convert coordinates of a pixel in the dataset to the coordinates of the imageView axes. More... | |
function | convertModel (type) |
Convert model from uint6 to uint8 and other way around. More... | |
function | copyColorChannel (channel1, channel2) |
Copy intensity from the first color channel (channel1) to the position of the second color channel (channel2). More... | |
function | createModel (model_type) |
Create an empty model: allocate memory for a new model. More... | |
function | cropDataset (cropF) |
Crop image and all corresponding layers of the opened dataset. More... | |
function | deleteColorChannel (channel1) |
Delete specified color channel from the dataset. More... | |
function result = | deleteSlice (sliceNumber, orient) |
Delete specified slice from the dataset. More... | |
function bb = | getBoundingBox () |
Get Bounding box info as a vector [xmin, width, ymin, height, zmin, thickness]. More... | |
function slice = | getCurrentSlice (type, countour_id) |
Get currently shown slice. More... | |
function
slice_no = | getCurrentSliceNumber () |
Get slice number of the currently shown image. More... | |
function
timePnt = | getCurrentTimePoint () |
Get time point of the currently shown image. More... | |
function slice = | getData2D (type, slice_no, orient, col_channel, custom_img, options) |
Get the 3D slice: height:width:colors. More... | |
function
dataset = | getData3D (type, time, orient, col_channel, options, custom_img) |
Get the 4D dataset: height:width:colors:depth. More... | |
function
dataset = | getData4D (type, orient, col_channel, options, custom_img) |
Get complete 4D dataset. More... | |
function
dataset = | getDataset (type, permuteSw, col_channel, options) |
Get 4D dataset, [height, width, color, depth], LEGACY function, please use imageData.getData3D instead! More... | |
function imgRGB = | getRGBimage (handles, options, sImgIn) |
Generate RGB image from all layers that have to be shown on the screen. More... | |
function | invertColorChannel (channel1) |
Invert color channel of the dataset. More... | |
function | generateModelColors () |
Generate list of colors for materials of a model. More... | |
function [
height , width , color , thick , time ] = | getDatasetDimensions (type, orient, color, options) |
Get dimensions of the dataset. More... | |
function slice = | getFullSlice (type, slice_no, orient, col_channel, custom_img, options) |
Get the whole, uncropped 3D slice. More... | |
function [
totalSize , imSize ] = | getDatasetSizeInBytes () |
Get size of the loaded dataset in bytes. More... | |
function
modelMaterialNames = | getMaterialNames () |
Get names of materials of the model. More... | |
function imgOut = | getRoiCrop (type, handles, roiNo, options, col_channel) |
Get a 3D dataset from the defined ROI regions. More... | |
function imgOut = | getRoiCropSlice (type, handles, roiNo, sliceNo, orient, options, col_channel) |
Get a 2D slice of the ROI regions only. More... | |
function [
yMin , yMax , xMin , xMax ] = | getCoordinatesOfShownImage () |
Return minimal and maximal coordinates (XY) of the image that is currently shown. More... | |
function slice = | getSlice (type, slice_no, orient, col_channel, custom_img, options) |
Get the 2D slice. More... | |
function slice = | getSliceToShow (type, slice_no, orient, col_channel, custom_img, options) |
Get a part of the 3D slice that fits into the viewing window of the handles.imageAxes, Note! the image will be cropped. More... | |
function | insertEmptyColorChannel (channel1) |
Insert an empty color channel to the specified position. More... | |
function
handles = | insertSlice (img, handles, insertPosition, img_info) |
Insert a slice or a dataset into the existing volume. More... | |
function | mark2selection (layer_id, type, str_type, xy_vec) |
Add a marker/pointer to the selection layer. More... | |
function | moveMaskToSelectionDataset (action_type, options) |
Move the Mask layer to the Selection layer. More... | |
function | moveModelToMaskDataset (action_type, options) |
Move the selected Material to the Mask layer. More... | |
function | moveModelToSelectionDataset (action_type, options) |
Move the selected Material to the Selection layer. More... | |
function | moveSelectionToMaskDataset (action_type, options) |
Move the Selection layer to the Mask layer. More... | |
function | moveSelectionToModelDataset (action_type, options) |
Move selection layer to the model layer. More... | |
function | moveView (x, y, orient) |
Center the image view at the provided coordinates: x, y. More... | |
function
handles = | plotImage (axes, handles, resize, sImgIn) |
Plot image to the axes. The main drawing function. More... | |
function
handles = | replaceDataset (img, handles, img_info, modelImg, maskImg, selectionImg) |
Replace existing dataset with a new one. More... | |
function
handles = | replaceImageColor (handles, type) |
Replace image intensities in the Masked or Selected areas with new intensity value. More... | |
function | resizeImage (new_width, new_height, method) |
Resize all layers using specified method. More... | |
function | rotateColorChannel (channel1) |
Rotate color channel of the dataset. More... | |
function | clearSelection (height, width, z, t) |
Clear the Selection layer. It is also possible to specify the area where the Selection layer should be cleared. More... | |
function | setCurrentSlice (type, slice, color_id) |
Update the currently shown slice of the dataset. More... | |
function result = | setData2D (type, slice, slice_no, orient, col_channel, custom_img, options) |
set the 3D slice: height:width:colors to the dataset More... | |
function result = | setData3D (type, dataset, time, orient, col_channel, options, custom_img) |
Set the 4D dataset (height:width:colors:depth) into the 5D dataset. More... | |
function result = | setData4D (type, dataset, orient, col_channel, options) |
result = setData4D(obj, type, dataset, orient, col_channel, options) Set complete 5D dataset More... | |
function result = | setDataset (type, dataset, permuteSw, col_channel, options) |
Update complete 4D dataset, LEGACY function, please use imageData.setData3D instead! More... | |
function
custom_img = | setFullSlice (type, slice, slice_no, orient, col_channel, custom_img, options) |
Update the full 2D slice of the dataset. More... | |
function
handles = | setMaterialNames (modelMaterialNames, handles) |
Set names for materials of the model. More... | |
function | setRoiCrop (type, imgIn, handles, roiNo, options, col_channel) |
Update a full 3D dataset from the defined ROI regions. More... | |
function | setRoiCropSlice (type, imgIn, handles, roiNo, sliceNo, orient, options, col_channel) |
Update a 2D slice of the ROI regions of the dataset. More... | |
function
custom_img = | setSlice (type, slice, slice_no, orient, col_channel, custom_img, options) |
Update the 2D slice of the dataset. More... | |
function
custom_img = | setSliceToShow (type, slice, slice_no, orient, col_channel, custom_img, options) |
Update the croped to the viewing window 2D slice of the dataset. More... | |
function | swapColorChannels (channel1, channel2) |
Swap two color channels of the dataset. More... | |
function | transpose (new_orient) |
Change orientation of the image to the XY, XZ, or YZ plane. More... | |
function
handles = | updateAxesLimits (handles, mode, newMagFactor) |
Updates the imageData.axesX and imageData.axesY during fit screen, resize, or new dataset drawing. More... | |
function | updateBoundingBox (newBB, xyzShift, imgDims) |
Update the bounding box info of the dataset. More... | |
function | updateDisplayParameters () |
Update display parameters for visualization. More... | |
function | updateImgInfo (addText, action, entryIndex) |
Update action log. More... | |
function result = | updateParameters (pixSize) |
Update imageData.pixelSize, imageData.img_info('XResolution') and imageData.img_info('XResolution') More... | |
imageData (handles, model_type, img) | |
Constructor for the imageData class. More... | |
Public Attributes | |
axesX | |
a vector [min, max] with minimal and maximal coordinates of the axes X of the imageAxes axes More... | |
axesY | |
a vector [min max] with minimal and maximal coordinates of the axes Y of the imageAxes axes More... | |
blockModeSwitch | |
defines whether to get the whole dataset or only the shown part of it, either 0 or 1 More... | |
brush_prev_xy | |
coordinates of the previous pixel for the Brush tool, More... | |
brush_selection | |
selection layer during the brush tool movement, More... | |
colors | |
number of color channels More... | |
current_yxz | |
a vector to remember last selected slice number of each yx , zx , zy planes, More... | |
height | |
image height, px More... | |
hLabels | |
a handle to class to keep labels More... | |
hMeasure | |
a handle to class to keep measurements More... | |
hROI | |
handle to ROI class, roiImage More... | |
img | |
a property to keep the Image layer. More... | |
img_info | |
information about the dataset, an instance of the containers .Map class Default keys: More... | |
imh | |
handle for the currently shown image More... | |
Ishown | |
a property to keep the currently displayed image in RGB format More... | |
lutColors | |
a matrix with LUT colors [1:colorChannel, R G B], (0-1) More... | |
magFactor | |
magnification factor for the currently shown image, 1=100%, 1.5 = 150% More... | |
maskExist | |
a switch to indicate presense of the Mask layer. Can be 0 (no model) or 1 (model exist) More... | |
maskImg | |
a property to keep the Mask layer More... | |
maskImgFilename | |
file name of the Mask layer image More... | |
maskStat | |
Statistics for the Mask layer with the PixelList info returned by regionprops Matlab function. More... | |
model | |
model is a property to keep the Model layer More... | |
model_fn | |
model_fn is a property to keep filename of the Model layer More... | |
model_type | |
The type of a model. More... | |
model_var | |
model_var is a variable name in the mat-file to keep the Model layer More... | |
model_diff_max | |
maximal absolute value in the image model of the diff_map type More... | |
modelMaterialColors | |
a matrix of colors [0-1] for materials of the Model , [materialIndex, R G B] More... | |
modelMaterialNames | |
an array of strings to define names of materials of the Model More... | |
modelExist | |
a switch to indicate presense of the Model layer. Can be 0 (no model) or 1 (model exist) More... | |
no_stacks | |
number of stacks in the dataset More... | |
orientation | |
Orientation of the currently shown dataset,. More... | |
pixSize | |
a structure with diminsions of voxels, More... | |
selection | |
a property to keep the Selection layer More... | |
slices | |
coordinates of the shown slice borders More... | |
storedSelection | |
a buffer to store selection with press of Ctrl+C button, and restore with Ctrl+V More... | |
time | |
number of time points in the dataset More... | |
trackerYXZ | |
starting point for the Membrane Click-tracer tool More... | |
viewPort | |
a structure More... | |
volren | |
a structure with parameters for the volume rendering the fields are More... | |
width | |
image width, px More... | |
EVENT | none |
when selected two or more curves More... | |
class is resposnible to keep and visualize datasets
imageData.imageData | ( | handles, | |
model_type, | |||
img | |||
) |
Constructor for the imageData class.
Create a new instance of the class with default parameters.
handles | - [optional] handles structure of im_browser model_type - [optional], parameter to setup the model type img - [optional], image to use to initialize imageData class |
References model_type.
function handles = imageData.addColorChannel | ( | img, | |
handles, | |||
channelId, | |||
lutColors | |||
) |
Add a new color channel to the existing dataset.
img | new 2D/3D image stack to add |
handles | handles structure from im_browser |
channelId | [optional] number (single!) of the channel to add, if NaN a new color channel is created |
lutColors | [optional] a matrix (channelNumber, R G B) for the colors. The colors should be in range between 0 and 1 |
handles | handles structure from im_browser |
Example:
function imageData.clearContents | ( | img | ) |
Set all elements of the class to default values.
img | - [optional], image to use to initialize imageData class |
Examples:
References img, and makeViewMatrix().
function imageData.clearMask | ( | height, | |
width, | |||
z, | |||
t | |||
) |
Clear the Mask
layer. It is also possible to specify the area where the Mask
layer should be cleared.
height | [optional] vector of heights, for example [1:imageData.height] or 0 - to initialize space for the new Mask |
width | [optional] vector of width, for example [1:imageData.width] |
z | [optional] vector of z-values, for example [1:imageData.no_stacks] |
t | [optional] vector of t-values, for example [1:imageData.time] |
Examples:
function imageData.clearSelection | ( | height, | |
width, | |||
z, | |||
t | |||
) |
Clear the Selection
layer. It is also possible to specify the area where the Selection
layer should be cleared.
height | [optional], can be NaN, a vector of heights(for example [1:imageData.height]) or a string with the mode (2D , 3D , 4D ) |
width | [optional], can be NaN, a vector of width, for example [1:imageData.width] |
z | [optional] a vector of z-values, for example [1:imageData.no_stacks] |
t | [optional] a vector of t-values, for example [1:imageData.time] |
Examples:
function [ xOut , yOut ] = imageData.convertDataToMouseCoordinates | ( | x, | |
y, | |||
mode, | |||
magFactor | |||
) |
Convert coordinates of a pixel in the dataset to the coordinates of the imageView axes.
x | x - coordinate |
y | y - coordinate |
mode | a string that defines a mode of the shown image: shown (in most cases), or full (for panning) |
magFactor | [optional], used to force magFactor, default obj.magFactor |
xOut | x - coordinate with the dataset |
yOut | y - coordinate with the dataset |
Examples:
function [ handles , status ] = imageData.convertImage | ( | format, | |
handles | |||
) |
Convert image to specified format: grayscale
, truecolor
, indexed
and uint8
, uint16
, uint32
class.
format | description of the new image format
|
handles | handles of im_browser.m |
handles | handles of im_browser.m |
status | 1 -success, 0 -fail |
Examples:
References img, mib_inputdlg(), and updateGuiWidgets().
function imageData.convertModel | ( | type | ) |
Convert model from uint6 to uint8 and other way around.
type | [optional] a type of a new model: uint8 or uint6 |
Examples:
function [ xOut , yOut , zOut , tOut ] = imageData.convertMouseToDataCoordinates | ( | x, | |
y, | |||
mode, | |||
permuteSw | |||
) |
Convert coordinates under the mouse cursor to the coordinates of the dataset.
x | x - coordinate |
y | y - coordinate |
mode | [optional] a string that defines a mode of the shown image, default is shown
|
permuteSw | [optional], can be empty
|
xOut | x - coordinate with the dataset |
yOut | y - coordinate with the dataset |
zOut | z - coordinate with the dataset |
tOut | t - time coordinate |
Examples:
function imageData.copyColorChannel | ( | channel1, | |
channel2 | |||
) |
Copy intensity from the first color channel (channel1) to the position of the second color channel (channel2).
The first color channel will be copied to the position of the second color channel
channel1 | [optional] index of the first color channel |
channel2 | [optional] index of the second color channel |
Examples:
References updateImgInfo().
function imageData.createModel | ( | model_type | ) |
Create an empty model: allocate memory for a new model.
Reinitialize imageData.model variable (NaN when no model present) with an empty matrix [imageData.height, imageData.width, imageData.no_stacks] of the defined type class
model_type | type of the model,
|
Examples:
References model_type.
function imageData.cropDataset | ( | cropF | ) |
Crop image and all corresponding layers of the opened dataset.
cropF | a vector [x1, y1, dx, dy, z1, dz, t1, dt] with parameters of the crop. Note! The units are pixels! |
Examples:
function imageData.deleteColorChannel | ( | channel1 | ) |
Delete specified color channel from the dataset.
channel1 | [optional] the index of color channel to delete. |
Examples:
References mib_inputdlg(), and updateImgInfo().
function result = imageData.deleteSlice | ( | sliceNumber, | |
orient | |||
) |
Delete specified slice from the dataset.
sliceNumber | the number of the slice to delete |
orient | [optional], can be NaN (in this case removes the currently shown)
|
result | result of the function, 0 fail, 1 success |
Examples:
function imageData.generateModelColors | ( | ) |
Generate list of colors for materials of a model.
When a new material is added to a model, this function generates a random color for it.
Examples:
function bb = imageData.getBoundingBox | ( | ) |
Get Bounding box info as a vector [xmin, width, ymin, height, zmin, thickness].
The bounding box info is needed to properly put the dataset in the 3D space. It is stored in the header of the Amira mesh file, or in the beginning of the ImageDescription field of the TIF file.
bb | - bounding box info
|
Examples:
function [ yMin , yMax , xMin , xMax ] = imageData.getCoordinatesOfShownImage | ( | ) |
Return minimal and maximal coordinates (XY) of the image that is currently shown.
yMin | - minimal Y coordinate |
yMax | - maximal Y coordinate |
xMin | - minimal Y coordinate |
xMax | - maximal Y coordinate |
Examples:
function slice = imageData.getCurrentSlice | ( | type, | |
countour_id | |||
) |
Get currently shown slice.
type | a string with type of the dataset to retrieve, image , model , mask , selection |
countour_id | - [optional],
|
slice | 3D image with dimensions [1:height, 1:width, 1:color] |
Examples
function slice_no = imageData.getCurrentSliceNumber | ( | ) |
Get slice number of the currently shown image.
slice_no | index of the currently shown slice |
Examples:
function timePnt = imageData.getCurrentTimePoint | ( | ) |
Get time point of the currently shown image.
timePnt | index of the currently shown slice |
Examples:
function slice = imageData.getData2D | ( | type, | |
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Get the 3D slice: height:width:colors.
type | type of the slice to retrieve, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice_no | [optional], an index of the slice to show, when NaN will show the current slice |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
options | [optional], a structure with extra parameters
|
slice | 3D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function dataset = imageData.getData3D | ( | type, | |
time, | |||
orient, | |||
col_channel, | |||
options, | |||
custom_img | |||
) |
Get the 4D dataset: height:width:colors:depth.
type | type of the slice to retrieve, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
time | [optional], an index of the time point to show, when NaN gets the dataset for the current time point |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
options | [optional], a structure with extra parameters
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
dataset | 4D image. For the image type: [1:height, 1:width, 1:colors, 1:depth]; for all other types: [1:height, 1:width, 1:depth] |
Examples:
function dataset = imageData.getData4D | ( | type, | |
orient, | |||
col_channel, | |||
options, | |||
custom_img | |||
) |
Get complete 4D dataset.
type | type of the dataset to retrieve, image , model ,mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
orient | [optional], can be NaN
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
dataset | 4D or 5D stack. For the image type: [1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:thickness, 1:time] |
Examples:
function dataset = imageData.getDataset | ( | type, | |
orient, | |||
col_channel, | |||
options | |||
) |
Get 4D dataset, [height, width, color, depth], LEGACY function, please use imageData.getData3D instead!
type | type of the dataset to retrieve, image , model ,mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
orient | [optional], can be NaN or empty
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
dataset | 4D stack. For the image type: [1:height, 1:width, 1:colors, 1:thickness]; for all other types: [1:height, 1:width, 1:thickness] |
Examples:
References time.
function [ height , width , color , depth , time ] = imageData.getDatasetDimensions | ( | type, | |
orient, | |||
color, | |||
options | |||
) |
Get dimensions of the dataset.
type | type of the dataset to retrieve dimensions, image (default), model , mask , selection |
orient | [optional], can be NaN
|
color | [optional], can be NaN
|
options | [optional], a structure with extra parameters
|
height | height of the dataset |
width | width of the dataset |
color | vector of colors of the dataset |
depth | number of z-layers of the dataset |
time | number of time points |
Examples:
function [ totalSize , imSize ] = imageData.getDatasetSizeInBytes | ( | ) |
Get size of the loaded dataset in bytes.
totalSize | - total size of all layers in bytes |
imSize | - size of the image layer in bytes |
Examples:
function slice = imageData.getFullSlice | ( | type, | |
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Get the whole, uncropped 3D slice.
type | type of the slice to retrieve, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice_no | [optional], an index of the slice to show, when NaN show the current slice |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
custom_img | the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
options | [optional], a structure with extra parameters
|
slice | 2D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function modelMaterialNames = imageData.getMaterialNames | ( | ) |
Get names of materials of the model.
modelMaterialNames | a cell array with names of materials |
Example:
References modelMaterialNames.
function imgRGB = imageData.getRGBimage | ( | handles, | |
options, | |||
sImgIn | |||
) |
Generate RGB image from all layers that have to be shown on the screen.
handles | handles structure from im_browser |
options | a structure with extra parameters:
|
sImgIn | a custom 3D stack to grab a single 2D slice from |
imgRGB | - RGB image with combined layers, [1:height, 1:width, 1:3] |
References ib_addText2Img().
Referenced by plotImage().
function imgOut = imageData.getRoiCrop | ( | type, | |
handles, | |||
roiNo, | |||
options, | |||
col_channel | |||
) |
Get a 3D dataset from the defined ROI regions.
Returns a cell(s) imgOut 3D stacks of the shown ROIs
type | type of the dataset to retrieve, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
handles | handles of im_browser.m |
roiNo | [optional] number of ROI to get, when omitted or NaN (default) take the currently selected ROIs. When 0 take all ROIs. Also it is possible to define ROI by its label as string of chars. |
options | [optional], a structure with extra parameters
|
col_channel | [optional],
|
imgOut | a cell array with 3D datasets from each selected ROI |
Examples:
function imgOut = imageData.getRoiCropSlice | ( | type, | |
handles, | |||
roiNo, | |||
sliceNo, | |||
orient, | |||
options, | |||
col_channel | |||
) |
Get a 2D slice of the ROI regions only.
Returns a cell(s) imgOut with 2D stacks of the shown ROIs.
type | type of the dataset to retrieve, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
handles | handles of im_browser.m |
roiNo | [optional] number of ROI to get, when omitted or NaN (default) take the currently selected ROIs. When 0 take all ROIs. Also it is possible to define ROI by its label as string of chars. |
sliceNo | [optional], number of the slice to get, when omitted or NaN returns the current slice |
orient | [optional], get a slice in the desired orientation
|
options | [optional], a structure with extra parameters
|
col_channel | [optional],
|
imgOut | a cell array containing 3D images of ROIs. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function slice = imageData.getSlice | ( | type, | |
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Get the 2D slice.
type | type of the slice to retrieve, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice_no | [optional], an index of the slice to show, when NaN will show the current slice |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
options | [optional], a structure with extra parameters
|
slice | 2D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function slice = imageData.getSliceToShow | ( | type, | |
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Get a part of the 3D slice that fits into the viewing window of the handles.imageAxes, Note! the image will be cropped.
type | type of the slice to retrieve, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice_no | [optional], an index of the slice to show, when empty or NaN will show the current slice |
orient | [optional], define orientation of the slice in the dataset
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
options | [optional], a structure with extra parameters
|
slice | cropped 2D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function imageData.insertEmptyColorChannel | ( | channel1 | ) |
Insert an empty color channel to the specified position.
channel1 | [optional] the index of color channel to insert. |
Examples:
References mib_inputdlg(), and updateImgInfo().
function handles = imageData.insertSlice | ( | img, | |
handles, | |||
insertPosition, | |||
img_info | |||
) |
Insert a slice or a dataset into the existing volume.
img | new 2D-4D image stack to insert |
handles | handles structure from im_browser |
insertPosition | [optional] position where to insert the new slice/volume starting from 1. When omitted or NaN add img to the end of the dataset |
img_info | [optional] containers Map with parameters of the dataset to insert |
handles | handles structure from im_browser |
Examples:
References img, img_info, mib_inputdlg(), and updateGuiWidgets().
function imageData.invertColorChannel | ( | channel1 | ) |
Invert color channel of the dataset.
The specified channel1 will be inverted
channel1 | [optional] index of the color channel to invert |
Examples:
References mib_inputdlg(), and updateImgInfo().
function imageData.mark2selection | ( | layer_id, | |
type, | |||
str_type, | |||
xy_vec | |||
) |
Add a marker/pointer to the selection layer.
layer_id | Index of the z-slice, for example (1) |
type | a type of the marker:
|
str_type | an additional identifier:
|
xy_vec | - coordinates of the markers, [1:number of points, [x, y]] |
Examples:
function imageData.moveMaskToSelectionDataset | ( | action_type, | |
options | |||
) |
Move the Mask layer to the Selection layer.
This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
function imageData.moveModelToMaskDataset | ( | action_type, | |
options | |||
) |
Move the selected Material to the Mask layer.
This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
function imageData.moveModelToSelectionDataset | ( | action_type, | |
options | |||
) |
Move the selected Material to the Selection layer.
This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
function imageData.moveSelectionToMaskDataset | ( | action_type, | |
options | |||
) |
Move the Selection layer to the Mask layer.
This is one of the specific function to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
function imageData.moveSelectionToModelDataset | ( | action_type, | |
options | |||
) |
Move selection layer to the model layer.
This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
function imageData.moveView | ( | x, | |
y, | |||
orient | |||
) |
Center the image view at the provided coordinates: x, y.
x | - X coordinate of the window center, or index of the point |
y | - [optional] Y coordinate of the window center, can be NaN |
orient | - [optional] define orientation of the point, default is the currently shown orientation
|
Examples:
function handles = imageData.plotImage | ( | axes, | |
handles, | |||
resize, | |||
sImgIn | |||
) |
Plot image to the axes. The main drawing function.
axes | handle to axes, use handles.imageAxes |
handles | handles structure from im_browser |
resize |
|
sImgIn | a custom 2D image to show in the axes that should be targeted to the axes. Use resize=0 to show sImgIn in the same scale/position as the currently shown dataset, or resize=1 to show sImgIn in full resolution |
handles | - handles of im_browser.m |
Examples:
References getRGBimage(), getRGBvolume(), and ib_updateCursor().
function handles = imageData.replaceDataset | ( | img, | |
handles, | |||
img_info, | |||
modelImg, | |||
maskImg, | |||
selectionImg | |||
) |
Replace existing dataset with a new one.
img | a new 2D/3D image stack |
handles | handles structure from im_browser |
img_info | [optional] a containers .Map class with parameters of the dataset, can be NaN |
modelImg | [optional] the Model layer, can be NaN |
maskImg | [optional] the Mask layer, can be NaN |
selectionImg | [optional] the Selection layer |
handles | handles structure from im_browser |
Examples:
References ib_updatePixSizeAndResolution(), img, img_info, makeViewMatrix(), maskImg, updateAxesLimits(), and updateGuiWidgets().
function handles = imageData.replaceImageColor | ( | handles, | |
type | |||
) |
Replace image intensities in the Masked or Selected areas with new intensity value.
The function starts a dialog that asks for a new intensity values to replace either the Masked or Selected areas.
handles | handles of im_browser.m |
type | specifies which layer to use for color replacement: 'mask' or 'selection' |
handles | handles of im_browser.m |
Examples:
References ib_do_backup().
function imageData.resizeImage | ( | new_width, | |
new_height, | |||
method | |||
) |
Resize all layers using specified method.
new_width | new width of the dataset |
new_height | new height of the dataset |
method | a method to use during resizing: 'nearest', 'bilinear', 'bicubic' |
Model
, Mask
, Selection
layers will be resized using the 'nearest' method. Examples:
function imageData.rotateColorChannel | ( | channel1 | ) |
Rotate color channel of the dataset.
The specified channel1 will be rotated
channel1 | [optional] index of the color channel to invert |
Examples:
handles.Img{handles.Id}.I.
References mib_inputdlg().
function imageData.setCurrentSlice | ( | type, | |
slice, | |||
color_id | |||
) |
Update the currently shown slice of the dataset.
type | type of the dataset to update, image , model , mask , selection , everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice | a new 2D slice, for the 'image' type [1:height,1:width, 1:color], for other latyers [1:height,1:width] |
color_id | [optional],
|
Examples:
References setSlice().
function result = imageData.setData2D | ( | type, | |
slice, | |||
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
set the 3D slice: height:width:colors to the dataset
type | type of the slice to set, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice | 3D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
slice_no | [optional], an index of the slice to update, when NaN updates the current slice |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset. |
options | [optional], a structure with extra parameters
|
slice | 3D image. For the image type: [1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width] |
Examples:
function result = imageData.setData3D | ( | type, | |
dataset, | |||
time, | |||
orient, | |||
col_channel, | |||
options, | |||
custom_img | |||
) |
Set the 4D dataset (height:width:colors:depth) into the 5D dataset.
type | type of the dataset to set, image , model ,mask , selection , custom (custom indicates to use custom_img as the dataset), everything (model ,mask and selection for imageData.model_type=='uint6' only) |
dataset | 3D or 4D stack. For the image type: [1:height, 1:width, 1:colors, 1:depth]; for all other types: [1:height, 1:width, 1:thickness] |
time | [optional], an index of the time point to show, when NaN gets the dataset for the current time point |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN
|
options | [optional], a structure with extra parameters
|
custom_img | [optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D/4D dataset. |
result | -> 1 - success, 0 - error |
Examples:
function result = imageData.setData4D | ( | type, | |
dataset, | |||
orient, | |||
col_channel, | |||
options | |||
) |
result = setData4D(obj, type, dataset, orient, col_channel, options) Set complete 5D dataset
type | type of the dataset to update, image , model ,mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
dataset | 4D or 5D stack. For the image type: [1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:thickness, 1:time] |
orient | [optional], can be NaN
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
result | -> 1 - success, 0 - error |
Examples:
function result = imageData.setDataset | ( | type, | |
dataset, | |||
orient, | |||
col_channel, | |||
options | |||
) |
Update complete 4D dataset, LEGACY function, please use imageData.setData3D instead!
type | type of the dataset to update, image , model , mask , selection , everything (model ,mask and selection for imageData.model_type=='uint6' only) |
dataset | a 4D stack with images |
orient | [optional], can be NaN
|
col_channel | [optional], can be NaN;
|
options | [optional], a structure with extra parameters
|
result | -> 1 - success, 0 - error |
Examples:
References time.
function custom_img = imageData.setFullSlice | ( | type, | |
slice, | |||
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Update the full 2D slice of the dataset.
type | type of the image to update, image , model , mask , selection , custom , 'everything
(get model, selection and mask, when imageData.model_type== uint6 ') |
slice | 2D image, for image type: [1:height, 1:width, 1:color], and [1:height, 1:width] for all other layers |
slice_no | [optional], number of the slice to set, when empty or NaN update the current slice |
orient | [optional], update the slice in the desired orientation
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; update a slice not from the imageData class but from this custom_img (3D dataset), requires the custom type |
options | [optional], a structure with extra parameters
|
custom_img |
|
Examples:
Referenced by setSlice().
function handles = imageData.setMaterialNames | ( | modelMaterialNames, | |
handles | |||
) |
Set names for materials of the model.
modelMaterialNames | a cell array with names for materials |
handles | handles structure from im_browser |
handles | handles structure from im_browser |
Example:
References model, modelMaterialNames, and updateSegmentationLists().
function imageData.setRoiCrop | ( | type, | |
imgIn, | |||
handles, | |||
roiNo, | |||
options, | |||
col_channel | |||
) |
Update a full 3D dataset from the defined ROI regions.
Note! Requires an array of cells as imgIn
type | type of the image to update, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
imgIn | a cell array with ROIs 3D volumes, |
handles | handles of im_browser.m |
roiNo | [optional] number of ROI to update, when omitted or NaN take the currently selected. When 0 update all ROIs. Also it is possible to define ROI by its label as string of chars. |
options | [optional], a structure with extra parameters
|
col_channel | [optional], can be NaN;
|
Examples:
function imageData.setRoiCropSlice | ( | type, | |
imgIn, | |||
handles, | |||
roiNo, | |||
sliceNo, | |||
orient, | |||
options, | |||
col_channel | |||
) |
Update a 2D slice of the ROI regions of the dataset.
Note! Requires an array of cells as imgIn
type | type of the image to update, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
imgIn | a cell array with ROIs 2D slices, |
handles | handles of im_browser.m |
roiNo | [optional] number of ROI to update, when omitted or NaN take the currently selected. When 0 take all ROIs. Also it is possible to define ROI by its label as string of chars. |
sliceNo | [optional], a number of the slice to update, when omitted or NaN update the current slice |
orient | [optional], update a slice in the desired orientation
|
options | [optional], a structure with extra parameters
|
col_channel | [optional], can be NaN
|
Examples:
function custom_img = imageData.setSlice | ( | type, | |
slice, | |||
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Update the 2D slice of the dataset.
type | type of the image to update, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice | 2D image, for image as [1:height,1:width,1:color]; for other layers as [1:height,1:width] |
slice_no | [optional] an index of the slice to update, when empty or NaN updates the current slice |
orient | [optional] update a slice in the desired orientation
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; update a slice not from the imageData class but from this custom_img (3D stack), requires the custom type |
options | [optional], a structure with extra parameters
|
custom_img | a modified 3D stack, for the custom type; or a status of the function run: - success, - fail. |
Examples:
References setFullSlice(), and setSliceToShow().
Referenced by setCurrentSlice().
function custom_img = imageData.setSliceToShow | ( | type, | |
slice, | |||
slice_no, | |||
orient, | |||
col_channel, | |||
custom_img, | |||
options | |||
) |
Update the croped to the viewing window 2D slice of the dataset.
type | type of the image to update, image , model , mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
slice | 2D image, for image as [1:height,1:width,1:color]; for other layers as [1:height,1:width] |
slice_no | [optional] an index of the slice to update, when empty or NaN updates the current slice |
orient | [optional] update a slice in the desired orientation
|
col_channel | [optional], can be NaN
|
custom_img | [optional], can be NaN; update a slice not from the imageData class but from this custom_img (3D stack), requires the custom type |
options | [optional], a structure with extra parameters
|
custom_img | a modified 3D stack, for the custom type; or a status of the function run: - success, - fail. |
Examples:
Referenced by setSlice().
function imageData.swapColorChannels | ( | channel1, | |
channel2 | |||
) |
Swap two color channels of the dataset.
The first color channel will be moved to the position of the second color channel, and the second color channel to the position of the first one
channel1 | [optional] index of the first color channel |
channel2 | [optional] index of the second color channel |
Examples:
References updateImgInfo().
function imageData.transpose | ( | new_orient | ) |
Change orientation of the image to the XY, XZ, or YZ plane.
new_orient | a desired orientation:
|
Examples:
function handles = imageData.updateAxesLimits | ( | handles, | |
mode, | |||
newMagFactor | |||
) |
Updates the imageData.axesX and imageData.axesY during fit screen, resize, or new dataset drawing.
handles | handles structure from im_browser handles structure from im_browser |
mode | update mode,
|
newMagFactor | a value of the new magnification factor, only for the zoom mode Return values: |
Examples:
Referenced by replaceDataset().
function imageData.updateBoundingBox | ( | newBB, | |
xyzShift, | |||
imgDims | |||
) |
Update the bounding box info of the dataset.
The bounding box info is needed to properly put the dataset in the 3D space. It is encoded in the header of the Amira mesh file, or in the beginning of the ImageDescription field of the TIF file.
newBB | - new Bounding Box parameters, Note! when NaN the dataset will be shifted with using xyzShift
|
xyzShift | [optional] a vector [height, width, z-stacks] with shifts of the bounding box; when omitted the function will use minimal parameters of the existing boinding box for the shitfs. Note! the units here are the image units: imageData.pixSize.units. |
imgDims | [optional] a vector [height, width, z-stacks] with dimensions of the image; when omitted the function will use imageData.height, imageData.width and imageData.no_stacks variables. Note! the units here are the image units: imageData.pixSize.units. |
Examples:
References no_stacks.
function imageData.updateDisplayParameters | ( | ) |
Update display parameters for visualization.
The function updates imageData.viewPort structure. It is called from the imageAdjustment.m dialog.
Examples:
function imageData.updateImgInfo | ( | addText, | |
action, | |||
entryIndex | |||
) |
Update action log.
This function updates the image log with recent events done to the dataset; it updates the contents of imageData.img_info('ImageDescription') key.
addText | a string that should be added to the log |
action | [optional] - defines additional actions that may be performed with the log:
|
entryIndex | [optional] - index of the entry to delete, modify or insert |
Examples:
Referenced by copyColorChannel(), deleteColorChannel(), insertEmptyColorChannel(), invertColorChannel(), and swapColorChannels().
function result = imageData.updateParameters | ( | pixSize | ) |
Update imageData.pixelSize, imageData.img_info('XResolution') and imageData.img_info('XResolution')
The function starts a dialog to update voxel size and the units of the dataset. As result the voxel dimensions will be updated; in addition imageData.img_info('XResolution') and imageData.img_info('YResolution') keys will be recalculated.
pixSize | - [optional], a structure with new parameters, may have the following fields
|
Examples:
References ib_calculateResolution(), and makeViewMatrix().
imageData.axesX |
a vector [min, max] with minimal and maximal coordinates of the axes X of the imageAxes
axes
imageData.axesY |
a vector [min max] with minimal and maximal coordinates of the axes Y of the imageAxes
axes
imageData.blockModeSwitch |
defines whether to get the whole dataset or only the shown part of it, either 0 or 1
imageData.brush_prev_xy |
coordinates of the previous pixel for the Brush tool,
imageData.brush_selection |
selection layer during the brush tool movement,
brush_selection{1} - contains brush selection during drawing brush_selection{2} - contains labels of the supervoxels and some additional information .slic - a label image with superpixels .selectedSlic - a bitmap image of the selected with the Brush tool superpixels .selectedSlicIndices - indices of the selected Slic superpixels .selectedSlicIndicesNew - a list of freshly selected Slic indices when moving the brush, used for the undo with Ctrl+Z .CData - a copy of the shown in the imageAxes image, to be used for the undo brush_selection{3} - a structure that contains information for the adaptive mode: .meanVals - array of mean intensity values for each superpixels .mean - mean intensity value for the initial selection .std - standard deviation of intensities for the initial selection .factor - factor that defines variation of STD variation
brush_selection
is modified with respect to and crop of the image within the viewing window imageData.colors |
number of color channels
imageData.current_yxz |
a vector to remember last selected slice number of each yx
, zx
, zy
planes,
imageData.height |
image height, px
Referenced by clearSelection(), getDatasetDimensions(), getFullSlice(), getSliceToShow(), setFullSlice(), and setSliceToShow().
imageData.hLabels |
a handle to class to keep labels
imageData.hMeasure |
a handle to class to keep measurements
imageData.hROI |
handle to ROI class, roiImage
imageData.img |
a property to keep the Image
layer.
Image
layer dimensions:. Referenced by addColorChannel(), clearContents(), clearSelection(), convertImage(), insertSlice(), and replaceDataset().
imageData.img_info |
information about the dataset, an instance of the containers
.Map
class Default keys:
Referenced by insertSlice(), and replaceDataset().
imageData.imh |
handle for the currently shown image
imageData.Ishown |
imageData.lutColors |
a matrix with LUT colors [1:colorChannel, R G B], (0-1)
Referenced by addColorChannel().
imageData.magFactor |
magnification factor for the currently shown image, 1=100%, 1.5 = 150%
imageData.maskExist |
a switch to indicate presense of the Mask
layer. Can be 0 (no model) or 1 (model exist)
imageData.maskImg |
a property to keep the Mask
layer
Mask
dimensions are: Referenced by replaceDataset().
imageData.maskImgFilename |
file name of the Mask
layer image
imageData.maskStat |
Statistics for the Mask
layer with the PixelList
info returned by regionprops
Matlab function.
imageData.model |
model is a property to keep the Model
layer
Referenced by setMaterialNames().
imageData.model_diff_max |
maximal absolute value in the image model of the diff_map
type
imageData.model_fn |
model_fn is a property to keep filename of the Model
layer
imageData.model_type |
The type of a model.
uint6
- a segmentation model with upto 63 materials; the Model
, Mask
and Selection
layers stored in the same matrix, to decrease memory consumption; Selection
layerMask
layerModel
layer, the maximal number of Materials in this type of model is 63.Model
, Mask
and Selection
layers stored in separate matrices;uint8
classint8
class Referenced by createModel(), and imageData().
imageData.model_var |
model_var is a variable name in the mat-file to keep the Model
layer
imageData.modelExist |
a switch to indicate presense of the Model
layer. Can be 0 (no model) or 1 (model exist)
imageData.modelMaterialColors |
a matrix of colors [0-1] for materials of the Model
, [materialIndex, R G B]
imageData.modelMaterialNames |
an array of strings to define names of materials of the Model
Referenced by getMaterialNames(), and setMaterialNames().
imageData.no_stacks |
number of stacks in the dataset
Referenced by updateBoundingBox().
imageData.none |
imageData.orientation |
Orientation of the currently shown dataset,.
yz
plane, default zx
plane zy
plane imageData.pixSize |
a structure with diminsions of voxels,
the fields are
imageData.selection |
a property to keep the Selection layer
imageData.slices |
imageData.storedSelection |
imageData.time |
number of time points in the dataset
Referenced by getDataset(), getDatasetDimensions(), and setDataset().
imageData.trackerYXZ |
starting point for the Membrane Click-tracer tool
imageData.viewPort |
a structure
for image adjustment the fields are
imageData.volren |
a structure with parameters for the volume rendering the fields are
imageData.width |
image width, px
Referenced by clearSelection(), getDatasetDimensions(), getFullSlice(), getSliceToShow(), setFullSlice(), and setSliceToShow().