Rescale class. More...
#include <gdcmRescaler.h>
Public Member Functions | |
Rescaler () | |
~Rescaler () | |
PixelFormat::ScalarType | ComputeInterceptSlopePixelType () |
PixelFormat | ComputePixelTypeFromMinMax () |
bool | InverseRescale (char *out, const char *in, size_t n) |
Inverse transform. | |
bool | Rescale (char *out, const char *in, size_t n) |
Direct transform. | |
void | SetIntercept (double i) |
Set Intercept: used for both direct&inverse transformation. | |
void | SetMinMaxForPixelType (double min, double max) |
void | SetPixelFormat (PixelFormat const &pf) |
Set Pixel Format of input data. | |
void | SetSlope (double s) |
Set Slope: user for both direct&inverse transformation. | |
Protected Member Functions | |
template<typename TIn > | |
void | InverseRescaleFunctionIntoBestFit (char *out, const TIn *in, size_t n) |
template<typename TIn > | |
void | RescaleFunctionIntoBestFit (char *out, const TIn *in, size_t n) |
Rescale class.
Example: Let say input is FLOAT64, and we want UINT16 as ouput, we would doM
Rescaler ir; ir.SetIntercept( 0 ); ir.SetSlope( 5.6789 ); ir.SetPixelFormat( FLOAT64 ); ir.SetMinMaxForPixelType( ((PixelFormat)UINT16).GetMin(), ((PixelFormat)UINT16).GetMax() ); ir.InverseRescale(output,input,numberofbytes );
gdcm::Rescaler::Rescaler | ( | ) | [inline] |
gdcm::Rescaler::~Rescaler | ( | ) | [inline] |
PixelFormat::ScalarType gdcm::Rescaler::ComputeInterceptSlopePixelType | ( | ) |
Compute the Pixel Format of the output data Used for direct transformation
PixelFormat gdcm::Rescaler::ComputePixelTypeFromMinMax | ( | ) |
Compute the Pixel Format of the output data Used for inverse transformation
bool gdcm::Rescaler::InverseRescale | ( | char * | out, | |
const char * | in, | |||
size_t | n | |||
) |
Inverse transform.
void gdcm::Rescaler::InverseRescaleFunctionIntoBestFit | ( | char * | out, | |
const TIn * | in, | |||
size_t | n | |||
) | [inline, protected] |
bool gdcm::Rescaler::Rescale | ( | char * | out, | |
const char * | in, | |||
size_t | n | |||
) |
Direct transform.
void gdcm::Rescaler::RescaleFunctionIntoBestFit | ( | char * | out, | |
const TIn * | in, | |||
size_t | n | |||
) | [inline, protected] |
void gdcm::Rescaler::SetIntercept | ( | double | i | ) | [inline] |
Set Intercept: used for both direct&inverse transformation.
void gdcm::Rescaler::SetMinMaxForPixelType | ( | double | min, | |
double | max | |||
) | [inline] |
Set target interval for output data. A best match will be computed (if possible) Used for inverse transformation
void gdcm::Rescaler::SetPixelFormat | ( | PixelFormat const & | pf | ) | [inline] |
Set Pixel Format of input data.
void gdcm::Rescaler::SetSlope | ( | double | s | ) | [inline] |
Set Slope: user for both direct&inverse transformation.