T
- imglib2 pixel typepublic class ImarisDataset<T extends NativeType<T> & RealType<T>> extends Object implements EuclideanSpace, ChannelSources<T>
ImarisDataset
wraps an Imaris IDataSetPrx
into a lazy-loaded
ImgLib2 CachedCellImg
.
Data is lazy-loaded from Imaris -- image blocks, when they are first accessed, are retrieved through the Imaris XT API and cached. Modified image blocks are persisted back to Imaris before they are evicted from the cache. (Imaris then in turn persists modified blocks to disk when they are evicted from its cache.)
ImarisDataset
provides various views on the image data:
Img
, via the asImg()
method,ImgPlus
with metadata, via the asImgPlus()
method,net.imagej.Dataset
with metadata, via the asDataset()
method,getSources()
method. The sources are multi-resolution and have
volatile versions for non-blocking display in BDV.
All these are views on the same data, backed by a common cache. Note, that
only the last one exposes the Imaris resolution pyramid. The Img
,
ImgPlus
, and net.imagej.Dataset
views represent the
full-resolution image.
The generic pixel type T
is one of UnsignedByteType
, UnsignedShortType
, FloatType
, and matches the type of the Imaris
dataset.
Constructor and Description |
---|
ImarisDataset(Context context,
Imaris.IDataSetPrx dataset)
Wrap an existing
IDataSetPrx . |
ImarisDataset(Context context,
Imaris.IDataSetPrx dataset,
ImarisDatasetOptions options)
Wrap an existing
IDataSetPrx . |
Modifier and Type | Method and Description |
---|---|
Dataset |
asDataset()
|
CachedCellImg<T,?> |
asImg()
Get the full resolution image.
|
ImgPlus<T> |
asImgPlus()
Get an
ImgPlus wrapping the full resolution image (see asImg() ). |
SharedQueue |
getCacheControl()
Get the
SharedQueue used for asynchronous loading of blocks from Imaris. |
DatasetCalibration |
getCalibration()
Get the physical calibration: unit, voxel size, and min in XYZ.
|
ARGBType |
getChannelColor(int channel)
Get the base color of a channel.
|
DatasetDimensions |
getDatasetDimensions()
Get the size of the underlying
5D Imaris dataset and the mapping to dimensions of the ImgLib2
representation.
|
String |
getFilename()
Get the
"Image > Filename" parameter of the dataset. |
Imaris.IDataSetPrx |
getIDataSetPrx()
Get the underlying
IDataSet ICE proxy. |
String |
getName()
Get the
"Image > Name" parameter of the dataset. |
List<SourceAndConverter<T>> |
getSources()
Get a list of BigDataViewer sources, one for each channel of the dataset.
|
T |
getType()
Get an instance of the pixel type.
|
void |
invalidatePyramid()
Invalidate cache for all levels of the resolution pyramid, except the
full resolution.
|
int |
numDimensions() |
int |
numResolutions()
Get the number of levels in the resolution pyramid.
|
int |
numTimepoints()
Get the number timepoints.
|
void |
persist()
Persist all modifications back to Imaris.
|
void |
setCalibration(DatasetCalibration calibration)
Sets unit, voxel size, and min coordinate.
|
void |
setCalibration(String unit,
float extendMinX,
float extendMaxX,
float extendMinY,
float extendMaxY,
float extendMinZ,
float extendMaxZ)
Sets unit, voxel size, and min coordinate from Imaris extents.
|
void |
setCalibration(VoxelDimensions voxelDimensions)
Set unit and voxel size.
|
void |
setCalibration(VoxelDimensions voxelDimensions,
double minX,
double minY,
double minZ)
Sets unit, voxel size, and min coordinate.
|
void |
setModified(boolean modified)
Set the modification flag of the Imaris dataset.
|
public ImarisDataset(Context context, Imaris.IDataSetPrx dataset) throws Imaris.Error
IDataSetPrx
.context
- a SciJava context. This is only required, if used as a net.imagej.Dataset
, otherwise can be null
.dataset
- the Imaris dataset to wrapImaris.Error
public ImarisDataset(Context context, Imaris.IDataSetPrx dataset, ImarisDatasetOptions options) throws Imaris.Error
IDataSetPrx
.context
- a SciJava context. This is only required, if used as a net.imagej.Dataset
, otherwise can be null
.dataset
- the Imaris dataset to wrapoptions
- additional options specifying which type of cache to use, etc.Imaris.Error
public void setCalibration(String unit, float extendMinX, float extendMaxX, float extendMinY, float extendMaxY, float extendMinZ, float extendMaxZ) throws Imaris.Error
Note, that the given min/max extents are in Imaris conventions: extendMinX
refers to the min corner of the min voxel of the dataset,
extendMaxX
refers to the max corner of the max voxel of the
dataset.
This is in contrast to the ImgLib2 convention, where coordinates always refer to the voxel center.
Imaris.Error
public void setCalibration(VoxelDimensions voxelDimensions) throws Imaris.Error
Imaris.Error
public void setCalibration(VoxelDimensions voxelDimensions, double minX, double minY, double minZ) throws Imaris.Error
Note, that the min coordinate is in ImgLib2 convention: It refers to the
voxel center. This is in contrast to Imaris conventions, where ExtendMinX, ExtendMinY, ExtendMinZ
indicate the min corner of the min voxel.
This method translates the given min coordinate (etc) to Imaris extendMin/Max
extents.
Imaris.Error
public void setCalibration(DatasetCalibration calibration) throws Imaris.Error
Note, that the min coordinate is in ImgLib2 convention: It refers to the
voxel center. This is in contrast to Imaris conventions, where ExtendMinX, ExtendMinY, ExtendMinZ
indicate the min corner of the min voxel.
This method translates the given min coordinate (etc) to Imaris extendMin/Max
extents.
Imaris.Error
public void setModified(boolean modified) throws Imaris.Error
Imaris asks whether to save a modified dataset, if modified=true
.
Set modified=false
, if you want Imaris to terminate without
prompting.
Imaris.Error
public CachedCellImg<T,?> asImg()
CachedCellImg
which loads blocks from Imaris, and
writes modified blocks back to Imaris.public ImgPlus<T> asImgPlus()
ImgPlus
wrapping the full resolution image (see asImg()
). Metadata and color tables are set up according to Imaris (at
the time of construction of this ImarisDataset
).public Dataset asDataset()
net.imagej.Dataset
wrapping the full resolution image
(see asImg()
, asImgPlus()
). Metadata and color tables are
set up according to Imaris (at the time of construction of this ImarisDataset
).public List<SourceAndConverter<T>> getSources()
getSources
in interface ChannelSources<T extends NativeType<T> & RealType<T>>
public SharedQueue getCacheControl()
SharedQueue
used for asynchronous loading of blocks from Imaris.getCacheControl
in interface ChannelSources<T extends NativeType<T> & RealType<T>>
public int numDimensions()
numDimensions
in interface EuclideanSpace
public int numResolutions()
public int numTimepoints()
numTimepoints
in interface ChannelSources<T extends NativeType<T> & RealType<T>>
public T getType()
getType
in interface ChannelSources<T extends NativeType<T> & RealType<T>>
public DatasetDimensions getDatasetDimensions()
public DatasetCalibration getCalibration()
public ARGBType getChannelColor(int channel) throws Imaris.Error
channel
- index of the channelImaris.Error
public String getFilename() throws Imaris.Error
"Image > Filename"
parameter of the dataset.Imaris.Error
public String getName() throws Imaris.Error
"Image > Name"
parameter of the dataset.Imaris.Error
public Imaris.IDataSetPrx getIDataSetPrx()
IDataSet
ICE proxy.public void persist()
public void invalidatePyramid()
While actual modifications to the full-resolution image are immediately
visible, updating the resolution pyramid needs to go through Imaris. That
is, after making modifications, first persist()
should be called
to ensure all changes have been transferred to Imaris. Second, the
dataset should be visible in Imaris, so that Imaris recomputes the
resolution pyramid. Finally, the lower-resolution images on the ImgLib2
side should be invalidated (using this method), so the recomputed pyramid
data is fetched from Imaris.
Copyright © 2019–2021 Imaris. All rights reserved.