Isis Developer Reference
|
Stores stretch information for a cube. More...
#include <CubeStretch.h>
Public Member Functions | |
CubeStretch (QString name="DefaultStretch", QString stretchType="Default", int bandNumber=1) | |
Constructs a CubeStretch object with default mapping of special pixel values to themselves and a provided name, and a provided stretch type. More... | |
CubeStretch (CubeStretch const &stretch) | |
Copy constructor for a CubeStretch. More... | |
CubeStretch (Stretch const &stretch) | |
Constructs a CubeStretch object from a normal Stretch. More... | |
CubeStretch (Stretch const &stretch, QString type) | |
Constructs a CubeStretch object from a normal Stretch. More... | |
CubeStretch (Blob blob) | |
Constructs a CubeStretch from a Blob. More... | |
~CubeStretch () | |
bool | operator== (CubeStretch &stretch2) |
Check if the CubeStretches are equal. More... | |
Isis::Blob | toBlob () const |
Serialize the CubeStretch to a Blob. More... | |
QString | getType () const |
Get the Type of Stretch. More... | |
void | setType (QString stretchType) |
Set the type of Stretch. More... | |
QString | getName () const |
Get the Stretch name. More... | |
void | setName (QString name) |
Set the Stretch name. More... | |
int | getBandNumber () const |
Get the band number for the stretch. More... | |
void | setBandNumber (int bandNumber) |
Set the band number for the stretch. More... | |
void | AddPair (const double input, const double output) |
Adds a stretch pair to the list of pairs. More... | |
void | SetNull (const double value) |
Sets the mapping for NULL pixels. More... | |
void | SetLis (const double value) |
Sets the mapping for LIS pixels. More... | |
void | SetLrs (const double value) |
Sets the mapping for LRS pixels. More... | |
void | SetHis (const double value) |
Sets the mapping for HIS pixels. More... | |
void | SetHrs (const double value) |
Sets the mapping for HRS pixels. More... | |
void | SetMinimum (const double value) |
void | SetMaximum (const double value) |
void | Load (Pvl &pvl, QString &grpName) |
Loads the stretch pairs from the pvl file into the Stretch object. More... | |
void | Load (QString &file, QString &grpName) |
Loads the stretch pairs from the pvl file into the Stretch object. More... | |
void | Save (Pvl &pvl, QString &grpName) |
void | Save (QString &file, QString &grpName) |
Saves the stretch pairs in the Stretch object into the given pvl file. More... | |
double | Map (const double value) const |
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings. More... | |
void | Parse (const QString &pairs) |
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair. More... | |
void | Parse (const QString &pairs, const Isis::Histogram *hist) |
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair where the input is a percentage. More... | |
QString | Text () const |
Converts stretch pair to a string. More... | |
int | Pairs () const |
Returns the number of stretch pairs. More... | |
double | Input (const int index) const |
Returns the value of the input side of the stretch pair at the specified index. More... | |
double | Output (const int index) const |
Returns the value of the output side of the stretch pair at the specified index. More... | |
void | ClearPairs () |
Clears the stretch pairs. More... | |
void | CopyPairs (const Stretch &other) |
Copies the stretch pairs from another Stretch object, but maintains special pixel values. More... | |
Stores stretch information for a cube.
Stores stretch pairs, band number associated with the stretch, and the stretch type from the Advanced Stretch Tool (or 'Default' if not specified)
Isis::CubeStretch::CubeStretch | ( | QString | name = "DefaultStretch" , |
QString | stretchType = "Default" , |
||
int | bandNumber = 1 |
||
) |
Constructs a CubeStretch object with default mapping of special pixel values to themselves and a provided name, and a provided stretch type.
name | Name to use for Stretch |
type | Type of stretch |
Isis::CubeStretch::CubeStretch | ( | CubeStretch const & | stretch | ) |
Copy constructor for a CubeStretch.
References getBandNumber(), getName(), and getType().
Isis::CubeStretch::CubeStretch | ( | Stretch const & | stretch | ) |
Constructs a CubeStretch object from a normal Stretch.
Stretch | Stretch to construct the CubeStretch from. |
Isis::CubeStretch::CubeStretch | ( | Stretch const & | stretch, |
QString | stretchType | ||
) |
Constructs a CubeStretch object from a normal Stretch.
Stretch | Stretch to construct the CubeStretch from. |
Isis::CubeStretch::CubeStretch | ( | Blob | blob | ) |
Constructs a CubeStretch from a Blob.
blob | The Blob to read data from. |
References Isis::Blob::getBuffer(), Isis::Blob::Label(), Isis::Stretch::Parse(), setBandNumber(), setName(), setType(), and Isis::Blob::Size().
Isis::CubeStretch::~CubeStretch | ( | ) |
|
inherited |
Adds a stretch pair to the list of pairs.
Note that all input pairs must be in ascending order.
input | Input value to map |
output | Output value when the input is mapped |
Isis::IException::Programmer | - input pairs must be in ascending order |
References _FILEINFO_.
Referenced by Isis::IndependentCubeViewport::cubeDataChanged(), Isis::VisualDisplay::setPixelData(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::StretchTool::stretchBand(), and Isis::StretchTool::stretchBuffer().
|
inlineinherited |
Clears the stretch pairs.
Referenced by Isis::IndependentCubeViewport::cubeDataChanged(), Isis::VisualDisplay::setPixelData(), and Isis::StretchTool::stretchBand().
|
inherited |
Copies the stretch pairs from another Stretch object, but maintains special pixel values.
other | - The Stretch to copy pairs from |
Referenced by Isis::StretchTool::loadStretchFromCube(), Isis::IndependentCubeViewport::restretch(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::ManualStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), Isis::CubeViewport::stretchGray(), and Isis::StretchTool::stretchRequested().
int Isis::CubeStretch::getBandNumber | ( | ) | const |
Get the band number for the stretch.
Referenced by CubeStretch(), operator==(), and toBlob().
QString Isis::CubeStretch::getName | ( | ) | const |
Get the Stretch name.
Referenced by CubeStretch(), operator==(), and toBlob().
QString Isis::CubeStretch::getType | ( | ) | const |
Get the Type of Stretch.
Referenced by CubeStretch(), Isis::AdvancedStretch::restoreSavedStretch(), and toBlob().
|
inherited |
Returns the value of the input side of the stretch pair at the specified index.
If the index number is out of bounds, then the method returns -1
index | The index number to retrieve the input stretch pair value from |
Referenced by Isis::HistogramWidget::setStretch(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), and Isis::StretchType::updateTable().
|
inherited |
Loads the stretch pairs from the pvl file into the Stretch object.
The pvl should look similar to this:
pvl | - The pvl containing the stretch pairs |
grpName | - The group name to get the input and output keywords from |
References _FILEINFO_, Isis::PvlObject::findGroup(), Isis::PvlContainer::findKeyword(), Isis::PvlKeyword::size(), Isis::toDouble(), and Isis::PvlObject::Traverse.
|
inherited |
|
inherited |
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings.
value | Value to map |
References Isis::IsHisPixel(), Isis::IsHrsPixel(), Isis::IsLisPixel(), Isis::IsNullPixel(), and Isis::IsValidPixel().
Referenced by Isis::VisualDisplay::paintPixmap().
bool Isis::CubeStretch::operator== | ( | CubeStretch & | stretch2 | ) |
Check if the CubeStretches are equal.
stretch2 | The stretch to compare with |
References getBandNumber(), getName(), and Isis::Stretch::Text().
|
inherited |
Returns the value of the output side of the stretch pair at the specified index.
If the index number is out of bounds, then the method returns -1.
index | The index number to retieve the output stretch pair value from |
Referenced by Isis::HistogramWidget::setStretch(), Isis::BinaryStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), and Isis::StretchType::updateTable().
|
inlineinherited |
Returns the number of stretch pairs.
Referenced by Isis::IndependentCubeViewport::cubeDataChanged(), Isis::HistogramWidget::setStretch(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), Isis::CubeViewport::stretchBlue(), Isis::StretchTool::stretchBuffer(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), Isis::CubeViewport::stretchRed(), and Isis::StretchType::updateTable().
|
inherited |
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair.
Therefore, the user can enter a string in this form and this method will parse the string and load the stretch pairs into the object via AddPairs.
pairs | A string containing stretch pairs for example "0:0 50:0 100:255 255:255" |
Isis::IException::User | - invalid stretch pair |
References _FILEINFO_.
Referenced by CubeStretch(), Isis::CubeViewport::stretchBlue(), Isis::CubeViewport::stretchGray(), Isis::CubeViewport::stretchGreen(), and Isis::CubeViewport::stretchRed().
|
inherited |
Parses a string of the form "i1:o1 i2:o2...iN:oN" where each i:o represents an input:output pair where the input is a percentage.
Using the Histogram an appropriate dn value will be calculated for each input percentage. Therefore, the user can enter a string in this form and this method will parse the string and load the stretch pairs into the object via AddPairs.
pairs | A string containing stretch pairs for example "0:0 50:0 100:255" |
Isis::IException::User | - invalid stretch pair |
References _FILEINFO_, and Isis::Histogram::Percent().
|
inherited |
|
inherited |
Saves the stretch pairs in the Stretch object into the given pvl file.
file | - The file that the stretch pairs will be written to |
grpName | - The name of the group to create and put the stretch pairs into. The group will contain two keywords, Input, and Output. |
References Isis::Pvl::write().
void Isis::CubeStretch::setBandNumber | ( | int | bandNumber | ) |
Set the band number for the stretch.
int | band number |
Referenced by CubeStretch(), and Isis::StretchTool::saveStretchToCube().
|
inlineinherited |
Sets the mapping for HIS pixels.
If not called the HIS pixels will be mapped to HIS. Otherwise you can map HIS to any double value. For example, SetHis(255.0).
value | Value to map input HIS |
Referenced by Isis::CubeViewport::BandInfo::BandInfo(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
|
inlineinherited |
Sets the mapping for HRS pixels.
If not called the HRS pixels will be mapped to HRS. Otherwise you can map HRS to any double value. For example, SetHrs(255.0).
value | Value to map input HRS |
Referenced by Isis::CubeViewport::BandInfo::BandInfo(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
|
inlineinherited |
Sets the mapping for LIS pixels.
If not called the LIS pixels will be mapped to LIS. Otherwise you can map LIS to any double value. For example, SetLis(0.0).
value | Value to map input LIS |
Referenced by Isis::CubeViewport::BandInfo::BandInfo(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
|
inlineinherited |
Sets the mapping for LRS pixels.
If not called the LRS pixels will be mapped to LRS. Otherwise you can map LRS to any double value. For example, SetLrs(0.0).
value | Value to map input LRS |
Referenced by Isis::CubeViewport::BandInfo::BandInfo(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
|
inlineinherited |
|
inlineinherited |
void Isis::CubeStretch::setName | ( | QString | name | ) |
Set the Stretch name.
QString | name for stretch |
Referenced by CubeStretch(), and Isis::StretchTool::saveStretchToCube().
|
inlineinherited |
Sets the mapping for NULL pixels.
If not called the NULL pixels will be mapped to NULL. Otherwise you can map NULLs to any double value. For example, SetNull(0.0).
value | Value to map input NULLs |
Referenced by Isis::CubeViewport::BandInfo::BandInfo(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
void Isis::CubeStretch::setType | ( | QString | stretchType | ) |
|
inherited |
Converts stretch pair to a string.
References Isis::toString().
Referenced by operator==(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::ManualStretchType::setStretch(), and toBlob().
Isis::Blob Isis::CubeStretch::toBlob | ( | ) | const |
Serialize the CubeStretch to a Blob.
The stretch will be serialized as a string. See Stretch::Text for more information.
References getBandNumber(), getName(), getType(), Isis::Blob::Label(), Isis::Blob::setData(), and Isis::Stretch::Text().
Referenced by Isis::StretchTool::saveStretchToCube(), and Isis::Cube::write().