Image set creation¶
-
class
CALCreateImageSet(projection_obj, image_params)¶ Constructor for the
CALCreateImageSetclass that creates an image set given aProjObjand structure of image transformation parameters.- Parameters
projection_obj -
ProjObjcontaining the projections OR a “plain” 3D projection matrix (FOR BACKWARD COMPATIBILITY)- image_params - structure of image transformation parameters (refer to image at the end of this section for visual depiction of some of the parameters)
image_width - width in pixels of the projection display, (THIS IS REQUIRED TO CREATE AN IMAGE SET)
image_height - height in pixels of the projection display, (THIS IS REQUIRED TO CREATE AN IMAGE SET)
t_offset - offset in the transverse or x-direction in pixels of the projection within the image
z_offset - offset in the z-direction in pixels of the projection within the image
array_num - number of copies of the projection within the image
array_offset - offset in the z-direction in pixels of each copy from each other
size_scale_factor - size scaling of the projection within the image
intensity_scale_factor - intensity scaling of the projection within the image (intensity saturates at 255)
invert_vert - flip orientation of the projection within the image over the transverse or horizontal axis
rotate - rotation in degrees of the projection within the image
angles(ONLY FOR BACKWARD COMPATIBILITY) - angles of the input 3D projection matrix
image_params.x
Default value
t_offset
0
z_offset
0
array_num
1
array_offset
0
size_scale_factor
1
intensity_scale_factor
1
invert_vert
0
rotate
0
- Returns
obj - instance of
CALCreateImageSet
-
classmethod
run(obj)¶
- Parameters
None
- Returns
image_set_obj -
ImageSetObjcontaining the image set
-
static
flipUD(proj)¶
- Parameters
proj - 3D projection matrix
- Returns
out - flipped input over transverse or horizontal axis
-
static
flipLR(proj)¶
- Parameters
proj - 3D projection matrix
- Returns
out - flipped input over z-axis
-
static
rotate(proj, angle)¶
- Parameters
proj - 3D projection matrix
angle - rotation angle in degrees
- Returns
out - input rotated by the input angle in the t-z plane
-
static
sizeScale(proj, scale)¶
- Parameters
proj - 3D projection matrix
scale - size scale factor
- Returns
out - input scaled by the input size scale factor
-
static
intensityScale(proj, scale)¶
- Parameters
proj - 3D projection matrix
scale - intensity scale factor
- Returns
out - input scaled by the input intensity scale factor
-
static
arrayInsertProj(proj, image_width, image_height, t_offset, z_offset, array_num, array_offset)¶
This method inserts a scaled and rotated projection into an image of the specified size (multiple times if specified by
array_num).- Parameters
proj - 3D projection matrix
image_width - display image width
image_height - display image height
t_offset - offset in the transverse or x-direction in pixels of the projection within the image
z_offset - offset in the z-direction in pixels of the projection within the image
array_num - number of copies of the projection within the image
array_offset - offset in the z-direction in pixels of each copy from each other
- Returns
image - image containing projection with transformations and translations applied
-
static
saveImages(image_set_obj, save_path, image_type)¶
- Parameters
image_set_obj -
ImageSetObjcontaining the image setsave_path - full path of the save location of a folder called
imagescontaining individual images named0001.jpg,0002.jpg, and so on, for example.image_type - file extension of image such as
'jpg','png','bmp', etc. The available image types can be found in Matlab’s documentation for imwrite()
-
static
saveVideo(image_set_obj, rot_vel, duration, save_path, video_type)¶
- Parameters
image_set_obj -
ImageSetObjcontaining the image setrot_vel - intended rotation velocity of the vial during a CAL print in deg/s
duration - total length of the video in seconds
save_path - full path of the intended save location
image_type - file extension of image such as
'MPEG-4','Grayscale AVI', etc. The available image types can be found in Matlab’s documentation for VideoWriter() input argument “profile - file type”