public class StackResampler extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
StackResampler.ImagePlusSlice
Helper class to store pixels and frameNr in one instance.
|
static class |
StackResampler.LinearTransformation
Helper class to do matrix calculations.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
FULL_VOLUME |
static int |
ORTHOGONAL_VIEWS |
static int |
YX_PROJECTION |
| Constructor and Description |
|---|
StackResampler(int mode,
boolean maxProjection,
double theta,
double cameraPixelSizeXyUm,
double sliceDistanceUm,
int zPixelShape,
int yPixelShape,
int xPixelShape)
StackResampler constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImageToRecons(short[] image,
int imageSliceIndex)
Add images only after first calling
initializeProjections. |
void |
addToProcessImageQueue(short[] image,
int sliceIndex)
Use this function to add Tagged images to the processing queue.
|
void |
addToProcessImageQueue(mmcorej.TaggedImage image)
Deprecated.
|
static String |
createSettingsKey(int mode,
double theta,
double cameraPixelSizeXyUm,
double sliceDistanceUm,
int zPixelShape,
int yPixelShape,
int xPixelShape)
Creates a String with values used to create a StackResampler.
|
void |
finalizeProjections()
Call after all images have arrived to finalize the projections.
|
short[][] |
getReconstructedVolumeZYX()
Returns reconstructed volume.
|
double |
getReconstructionVoxelSizeUm() |
int |
getResampledShapeX()
Returns the width of the resampled volume in pixels.
|
int |
getResampledShapeY()
Returns the height of the resampled volume.
|
int |
getResampledShapeZ()
Returns the number of frames of the resampled volume.
|
String |
getSettingsKey()
Returns a String unique for this StackResampler.
|
short[] |
getYXProjection()
Returns YX projection.
|
short[] |
getYZProjection()
Returns ZY projection.
|
short[] |
getZXProjection()
Returns ZX projection.
|
void |
initializeProjections()
Call this function before any images arrive to initialize the
projection and recon arrays.
|
Runnable |
startStackProcessing()
Pull images from the queue and process them in parallel until
a full z stack is processed or a null pix null tags stop signal is received.
|
public static final int YX_PROJECTION
public static final int ORTHOGONAL_VIEWS
public static final int FULL_VOLUME
public StackResampler(int mode,
boolean maxProjection,
double theta,
double cameraPixelSizeXyUm,
double sliceDistanceUm,
int zPixelShape,
int yPixelShape,
int xPixelShape)
mode - YX Projection (0), Orthogonal views (1), or full volume (2)maxProjection - Do a maximum intensity projection if true, otherwise returns
mean projections.theta - Angle between coverslip and lightsheet in radians, theta-tilt
in https://amsikking.github.io/SOLS_optimum_tilt/.cameraPixelSizeXyUm - Size of one (square) camera pixel in the object plane
in microns.sliceDistanceUm - Distance (in microns) between two slices of the input stack in the
object plane. Distance is measured in the plane parallel with the
coverslip.zPixelShape - Number of slices (z planes) in the input stack.yPixelShape - Image height in pixel numberxPixelShape - Image width in pixel numberpublic static String createSettingsKey(int mode, double theta, double cameraPixelSizeXyUm, double sliceDistanceUm, int zPixelShape, int yPixelShape, int xPixelShape)
mode - YX Projection (0), Orthogonal views (1), or full volume (2)theta - Angle with optical axis in radians.cameraPixelSizeXyUm - Size of one (square) camera pixel in the object plane
in microns.sliceDistanceUm - Distance (in microns) between two slices of the input stack in the
object plane. Distance is measured in the plane parallel with the
coverslip.zPixelShape - Number of slices (z planes) in the input stack.yPixelShape - Image height in pixel numberxPixelShape - Image width in pixel numberpublic String getSettingsKey()
public void initializeProjections()
public void addImageToRecons(short[] image,
int imageSliceIndex)
initializeProjections.
It appears that this function is meant for internal use, and that it is
preferred to add images using addToProcessImageQueue(short[], int)
and start processing using startStackProcessing(). If
synchronous execution is OK, it should be fine to use this method and signal
that no more images will be added using (finalizeProjections()image - array containing pixel data with width and height as set in
the constructor.imageSliceIndex - z plane number, starting with 0.public void finalizeProjections()
public double getReconstructionVoxelSizeUm()
public short[] getYXProjection()
finalizeProjections().public short[] getYZProjection()
finalizeProjections().public short[] getZXProjection()
finalizeProjections().public short[][] getReconstructedVolumeZYX()
finalizeProjections().public int getResampledShapeX()
public int getResampledShapeY()
public int getResampledShapeZ()
@Deprecated public void addToProcessImageQueue(mmcorej.TaggedImage image)
startStackProcessing().
Processing can (and should be) started before images are added
to the queue. The only tag in the TaggedImage that matters is the tag
"Z", containing the frame index as an integer starting at zero.image - TaggedImage containing pixel data of type short[], and the tag
"Z" with the frame index.public void addToProcessImageQueue(short[] image,
int sliceIndex)
startStackProcessing().
Processing can (and should be) started before images are added
to the queue. The only tag in the TaggedImage that matters is the tag
"Z", containing the frame index as an integer starting at zero.image - TaggedImage containg pixel data of type short[], and the tag
"Z" with the frame index.public Runnable startStackProcessing()
Copyright © 2023. All rights reserved.