The ImageProcessor class.
More...
Inherits QObject, and QScriptable.
|
bool | ConcatenateDatFiles (const QStringList &sourceImagePaths, const QString &destinationPath, const bool bOverwrite=false) |
| Concatenates one or more DAT image(s) (*.dat) to one CDAT (*.cdat) file. More...
|
|
bool | ConvertDatToPngFile (QString strSource, QString strDestination, bool bOverwrite=false) |
| Converts and saves a custom Dat (*.dat) file to a Png (*.png) file format. More...
|
|
bool | ConvertPngToDatFile (QString strSource, QString strDestination, bool bOverwrite=false) |
| Converts and saves a Png (*.png) file to the custom Dat (*.dat) file format. More...
|
|
bool | CreateMeanImageFromPngFiles (const QStringList &sourceImagePaths, const QString &destinationPath, const bool bOverwrite=false) |
| Creates a mean Png image (*.png) from one or more Png (*.png) images. More...
|
|
int | getCDATFileNrOfSubFrames (const QString &sourcePath) |
| Returns the amount of sub-images a specified CDAT (*.cdat) file contains. More...
|
|
QImage | getImageFromCDATFile (const QString &sourcePath, const int &nIndex=0) |
| Returns a specified QImage from a CDAT (*.cdat) file. More...
|
|
bool | ScalePngFile (QString strSource, QString strDestination, int nRatio=1, int nMethod=0, int nColorThreshold=255, bool bOverwrite=false, bool bSmoothFiltering=false) |
| Scales a a Png (*.png) file by a specified Ratio. More...
|
|
bool | ScalePngFileBySize (QString strSource, QString strDestination, int nXPixels, int nYPixels, int nMethod=0, int nColorThreshold=255, bool bOverwrite=false, bool bSmoothFiltering=false) |
| Scales a a Png (*.png) file by a specified Size. More...
|
|
int | SplitCDatFile (const QString &sourceImagePath, const QString &destinationPath, const QString &destPreFileName, const bool bOverwrite=false) |
| Splits a CDAT (*.cdat) file into one or more DAT (*.dat) image file(s). More...
|
|
The ImageProcessor class.
The Image Processor can be used to edit Png (*.png) and custom Dat (*.dat) files.
The enum ScalingMethod holds a Scaling Method for the ImageProcessor object
Enumerator |
---|
ScalingMethod_MonoColored |
default, Mono Colored.
|
ScalingMethod_SmoothGreyColored |
Smoothed (Grey value Colored).
|
ScalingMethod_SmoothMonoColored |
Smoothed and converted to a Mono Color values, threshold value = 255.
|
ScalingMethod_SmoothMonoColoredCustomThreshold |
Smoothed and converted to a Mono Color values, custom threshold value.
|
ImageProcessor::ImageProcessor |
( |
QObject * |
parent = NULL | ) |
|
The ImageProcessor constructor.
You do not need to specify the parent object. The BrainStim script engine automatically retrieves the parent role
ImageProcessor::~ImageProcessor |
( |
| ) |
|
The ImageProcessor destructor.
You do not need call the destructor. The BrainStim script engine automatically performs the garbage collection after you set the object to NULL and the script ends
bool ImageProcessor::ConcatenateDatFiles |
( |
const QStringList & |
sourceImagePaths, |
|
|
const QString & |
destinationPath, |
|
|
const bool |
bOverwrite = false |
|
) |
| |
|
slot |
Concatenates one or more DAT image(s) (*.dat) to one CDAT (*.cdat) file.
This function Concatenates one or more DAT (*.dat) image file(s) to one CDAT (*.cdat) file specified by a source list and destination directory path.
- Parameters
-
sourceImagePaths | a StringList containing the path(s) to the source DAT (*.dat) file(s). |
destinationPath | a String containing the path to destination concatenated CDAT (*.cdat) file. |
bOverwrite | a boolean value determining whether the destination file should be automatically overwritten when it already exists. |
- Returns
- a Boolean value representing whether the concatenated destination file could be saved.
bool ImageProcessor::ConvertDatToPngFile |
( |
QString |
strSource, |
|
|
QString |
strDestination, |
|
|
bool |
bOverwrite = false |
|
) |
| |
|
slot |
Converts and saves a custom Dat (*.dat) file to a Png (*.png) file format.
This function Converts and saves a custom Dat (*.dat) file to a Png (*.png) file format.
- Parameters
-
strSource | a String containing the path to the source Dat (*.dat) file. |
strDestination | a String containing the path to destination Png (*.png) file. |
bOverwrite | a Boolean value determing whether the destination file should be automatically overwritten when it already exists. |
- Returns
- a Boolean value representing whether the target file could be saved.
bool ImageProcessor::ConvertPngToDatFile |
( |
QString |
strSource, |
|
|
QString |
strDestination, |
|
|
bool |
bOverwrite = false |
|
) |
| |
|
slot |
Converts and saves a Png (*.png) file to the custom Dat (*.dat) file format.
This function Converts and saves a Png (*.png) file to the custom Dat (*.dat) file format.
- Parameters
-
strSource | a String containing the path to the source Png (*.png) file. |
strDestination | a String containing the path to destination Dat (*.dat) file. |
bOverwrite | a Boolean value determing whether the destination file should be automatically overwritten when it already exists. |
- Returns
- a Boolean value representing whether the target file could be saved.
bool ImageProcessor::CreateMeanImageFromPngFiles |
( |
const QStringList & |
sourceImagePaths, |
|
|
const QString & |
destinationPath, |
|
|
const bool |
bOverwrite = false |
|
) |
| |
|
slot |
Creates a mean Png image (*.png) from one or more Png (*.png) images.
This function Creates a mean Png image (*.png) from one or more Png (*.png) images specified by a source list and destination directory path.
- Parameters
-
sourceImagePaths | a StringList containing the path(s) to the source Png (*.png) file(s). |
destinationPath | a String containing the path to destination mean Image Png (*.png) file. |
bOverwrite | a boolean value determining whether the destination file should be automatically overwritten when it already exists. |
- Returns
- a Boolean value representing whether the mean image destination file could be saved.
int ImageProcessor::getCDATFileNrOfSubFrames |
( |
const QString & |
sourcePath | ) |
|
|
slot |
Returns the amount of sub-images a specified CDAT (*.cdat) file contains.
This function Returns the amount of sub-images a specified CDAT (*.cdat) file contains, specified by a source CDAT (*.cdat) file path.
- Parameters
-
sourcePath | a String containing the path to the source CDAT (*.cdat) file. |
- Returns
- a integer containing the number of sub-images, if this function could not execute properly it returns -1.
QImage ImageProcessor::getImageFromCDATFile |
( |
const QString & |
sourcePath, |
|
|
const int & |
nIndex = 0 |
|
) |
| |
|
slot |
Returns a specified QImage from a CDAT (*.cdat) file.
This function Returns a specified QImage from a CDAT (*.cdat) file, specified by a source CDAT (*.cdat) file path and a image index (0 based).
- Parameters
-
sourcePath | a String containing the path to the source CDAT (*.cdat) file. |
nIndex | a integer containing the index from the requested image in the source CDAT (*.cdat) file. |
- Returns
- a QImage object that contains the requested image data, if this function could not execute properly it return an QImage object with size(w=0,h=0).
bool ImageProcessor::ScalePngFile |
( |
QString |
strSource, |
|
|
QString |
strDestination, |
|
|
int |
nRatio = 1 , |
|
|
int |
nMethod = 0 , |
|
|
int |
nColorThreshold = 255 , |
|
|
bool |
bOverwrite = false , |
|
|
bool |
bSmoothFiltering = false |
|
) |
| |
|
slot |
Scales a a Png (*.png) file by a specified Ratio.
This function Scales and saves a Png (*.png) file to a specified destination.
- Parameters
-
strSource | a String containing the path to the source Png (*.png) file. |
strDestination | a String containing the path to destination Png (*.png) file. |
nRatio | an integer value containing Ratio to which the image should be scaled. |
nMethod | an integer value containing the Scaling Method, see ImageProcessor::ScalingMethod. |
nColorThreshold | an integer value containing the Threshold value in case the defined Scaling Method is ScalingMethod_SmoothMonoColoredCustomThreshold. |
bOverwrite | a Boolean value determining whether the destination file should be automatically overwritten when it already exists. |
bSmoothFiltering | a Boolean value determining whether a the resulting image is transformed using bilinear filtering. |
- Returns
- a Boolean value representing whether the target file could be saved.
bool ImageProcessor::ScalePngFileBySize |
( |
QString |
strSource, |
|
|
QString |
strDestination, |
|
|
int |
nXPixels, |
|
|
int |
nYPixels, |
|
|
int |
nMethod = 0 , |
|
|
int |
nColorThreshold = 255 , |
|
|
bool |
bOverwrite = false , |
|
|
bool |
bSmoothFiltering = false |
|
) |
| |
|
slot |
Scales a a Png (*.png) file by a specified Size.
This function Scales and saves a Png (*.png) file to a specified destination.
- Parameters
-
strSource | a String containing the path to the source Png (*.png) file. |
strDestination | a String containing the path to destination Png (*.png) file. |
nXPixels | an integer value containing the number of pixels (width) to which the image should be scaled. |
nYPixels | an integer value containing the number of pixels (height) to which the image should be scaled. |
nMethod | an integer value containing the Scaling Method, see ImageProcessor::ScalingMethod. |
nColorThreshold | an integer value containing the Threshold value in case the defined Scaling Method is ScalingMethod_SmoothMonoColoredCustomThreshold. |
bOverwrite | a Boolean value determining whether the destination file should be automatically overwritten when it already exists. |
bSmoothFiltering | a Boolean value determining whether a the resulting image is transformed using bilinear filtering. |
- Returns
- a Boolean value representing whether the target file could be saved.
int ImageProcessor::SplitCDatFile |
( |
const QString & |
sourceImagePath, |
|
|
const QString & |
destinationPath, |
|
|
const QString & |
destPreFileName, |
|
|
const bool |
bOverwrite = false |
|
) |
| |
|
slot |
Splits a CDAT (*.cdat) file into one or more DAT (*.dat) image file(s).
This function Splits a CDAT (*.cdat) file into one or more DAT (*.dat) image file(s), specified by a source and destination directory path.
- Parameters
-
sourceImagePath | a String containing the path to the source CDAT (*.cdat) file. |
destinationPath | a String containing the path to destination directory where the DAT (*.dat) file(s) are saved. |
destPreFileName | the prefix used for saving the split DAT (*.dat) file(s) –> "<destPreFileName>_<0 based DAT file index>.dat", e.g. studyxyz_3.dat. |
bOverwrite | a boolean value determining whether the destination file(s) should be automatically overwritten when it already exists. |
- Returns
- a Boolean value representing whether the split image file(s) could be saved to the destination directory.