VivoQuant
Public Slots | List of all members
ArithmeticOperator Class Reference

Object to interact with the Arithmetic Operator when it is active. More...

Public Slots

Index addScalar (Index idx, float scalar, bool newImg=false)
 Function to add scalar value to image. More...
 
Index multScalar (Index idx, float scalar, bool newImg=false)
 Function to multiply image by a scalar value. More...
 
Index multScalarSlices (Index idx, QList< Variant > scalars, bool newImg=false)
 Function to apply slice-by-slice scalar multiplication to an image. More...
 
Index addImage (Index idx, Index img, bool newImg=false)
 Function to add two images together. More...
 
Index multImage (Index idx, Index img, bool newImg=false)
 Function to multiply two images together. More...
 
Index subtractImage (Index idx, Index img, bool newImg=false)
 Function to subtract one image from another image. More...
 
Index divideImage (Index idx, Index img, bool newImg=false)
 Function to divide a selected image by another image. More...
 
Index powImage (Index idx, float exponent, bool newImg=false)
 Function to raise voxel values of image by an exponential value. More...
 
Index averageImages (Index idx, Array< Index > list)
 Function to average images together. More...
 
Index mergeImages (Index idx, Array< Index > list)
 Function to merge multiple images, where all signal is conserved and compiled into one image. More...
 
Index averageImages (Array< Index > list)
 Function to average a list of images into one new image. More...
 
Index mergeImages (Array< Index > list)
 Function to merge a list of images into one new image. More...
 
Index weightedAvgImages (Index idx, Array< Index > list)
 Function to weigthed averaging images together. More...
 
Index weightedAvgImages (Array< Index > list)
 Function to weigthed averaging a list of images into one new image. More...
 

Detailed Description

Object to interact with the Arithmetic Operator when it is active.

This object can be used to apply arithmetic operations on loaded images when the Arithmetics Operator is loaded.

Images are loaded in the data manager starting with the reference at 0 See also ScriptMaster::currentOp() to obtain this object and MainWin::setViewMode() to enter the Arithmetics Operator.

Member Function Documentation

◆ addImage

Index addImage ( Index  idx,
Index  img,
bool  newImg = false 
)
slot

Function to add two images together.

Parameters
idFirst image (see ScriptMaster::index()); this image will be augmented by adding the second image selected to it upon execution of function
imgSecond image; this will be added to the first image and remain unchanged
newImgIf true will create a new resultant image, leaving the two selected images unchanged
Returns
The id of the image to which the power was computed (will return the id of the new image if /p newImg was specified)

◆ addScalar

Index addScalar ( Index  idx,
float  scalar,
bool  newImg = false 
)
slot

Function to add scalar value to image.

Parameters
idImage that is selected to add scalar value to
scalarValue of that is added to the image
newImgIf true will create a new resultant image
Returns
The id of the image to which the power was computed (will return the id of the new image if newImg was specified)

◆ averageImages [1/2]

Index averageImages ( Array< Index >  list)
slot

Function to average a list of images into one new image.

Parameters
Array<Index>list of images that will be averaged together to make a new resultant image
Returns
The id of the newly created image

◆ averageImages [2/2]

Index averageImages ( Index  idx,
Array< Index >  list 
)
slot

Function to average images together.

Parameters
idxIndex of the first image (see ScriptMaster::index()); image will be averaged with list of images designated, and subsequently replaced by a resultant averaged image
Array<Index>List of images that will be averaged with the first image designated by 'id'; these images will remain unchanged after execution of function
Returns
The id of the image to which the average was computed

◆ divideImage

Index divideImage ( Index  idx,
Index  img,
bool  newImg = false 
)
slot

Function to divide a selected image by another image.

Parameters
idFirst image index (see ScriptMaster::index()); this image will be augmented by dividing it by a second image selected upon execution of function
imgSecond image; this image will be dividing the first image and remain unchanged
newImgIf true will create a new resultant image, leaving the two selected images unchanged
Returns
The id of the image to which the power was computed (will return the id of the new image if /p newImg was specified)

◆ mergeImages [1/2]

Index mergeImages ( Array< Index >  list)
slot

Function to merge a list of images into one new image.

Parameters
Array<Index>list of images that will be merged together and compiled into a new resultant image
Returns
The id of the newly created image

◆ mergeImages [2/2]

Index mergeImages ( Index  idx,
Array< Index >  list 
)
slot

Function to merge multiple images, where all signal is conserved and compiled into one image.

Parameters
idxFirst image; image will be merged with list of images designated, and subsequently replaced by a resultant merged image
Array<Index>list of images that will be merged with the first image designated by 'id'; these images will remain unchanged after execution of function
Returns
The id of the image to which the merge was computed

◆ multImage

Index multImage ( Index  idx,
Index  img,
bool  newImg = false 
)
slot

Function to multiply two images together.

Parameters
idFirst image (see ScriptMaster::index()); this image will be augmented by multiplying it by the second image selected upon execution of function
imgSecond image; this image will be multiplied with the first image and remain unchanged
newImgIf true will create a new resultant image, leaving the two selected images unchanged
Returns
The id of the image to which the power was computed (will return the id of the new image if /p newImg was specified)

◆ multScalar

Index multScalar ( Index  idx,
float  scalar,
bool  newImg = false 
)
slot

Function to multiply image by a scalar value.

Parameters
idImage selected to multiply by scalar value
scalarValue that image selected will be muliplied by
newImgIf true will create a new resultant image
Returns
The id of the image to which the power was computed (will return the id of the new image if newImg was specified)

◆ multScalarSlices

Index multScalarSlices ( Index  idx,
QList< Variant >  scalars,
bool  newImg = false 
)
slot

Function to apply slice-by-slice scalar multiplication to an image.

Parameters
IndexImage index
QList<Variant>List of scalars, one for each slice
newImgIf true will create a new resultant image, leaving the selected image unchanged
Returns
The id of the newly created image

◆ powImage

Index powImage ( Index  idx,
float  exponent,
bool  newImg = false 
)
slot

Function to raise voxel values of image by an exponential value.

Parameters
idimage index (see ScriptMaster::index()) to be raised by designated exponential value
exponentvalue of exponent
newImgIf true will create a new resultant image, leaving the selected image unchanged
Returns
The id of the image to which the power was computed (will return the id of the new image if /p newImg was specified)

◆ subtractImage

Index subtractImage ( Index  idx,
Index  img,
bool  newImg = false 
)
slot

Function to subtract one image from another image.

Parameters
idFirst image (see ScriptMaster::index()); this image will be augmented by subtracting it by a second image selected upon execution of function
imgSecond image; this image will be subtracted from the first image and remain unchanged
newImgIf true will create a new resultant image, leaving the two selected images unchanged
Returns
The id of the image to which the power was computed (will return the id of the new image if /p newImg was specified)

◆ weightedAvgImages [1/2]

Index weightedAvgImages ( Array< Index >  list)
slot

Function to weigthed averaging a list of images into one new image.

Parameters
Array<Index>list of images that will be weigthed averaged together to make a new resultant image
Returns
The id of the newly created image

◆ weightedAvgImages [2/2]

Index weightedAvgImages ( Index  idx,
Array< Index >  list 
)
slot

Function to weigthed averaging images together.

Parameters
idxIndex of the first image (see ScriptMaster::index()); image will be weigthed averaged with list of images designated, and subsequently replaced by a resultant weigthed averaged image
Array<Index>List of images that will be weigthed averaged with the first image designated by 'id'; these images will remain unchanged after execution of function
Returns
The id of the image to which the weigthed average was computed