![]() |
Isis 3 Programmer 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. | |
| CubeStretch (CubeStretch const &stretch) | |
| Copy constructor for a CubeStretch. | |
| CubeStretch (Stretch const &stretch) | |
| Constructs a CubeStretch object from a normal Stretch. | |
| CubeStretch (Stretch const &stretch, QString type) | |
| Constructs a CubeStretch object from a normal Stretch. | |
| CubeStretch (Blob blob) | |
| Constructs a CubeStretch from a Blob. | |
| bool | operator== (CubeStretch &stretch2) |
| Check if the CubeStretches are equal. | |
| Isis::Blob | toBlob () const |
| Serialize the CubeStretch to a Blob. | |
| QString | getType () const |
| Get the Type of Stretch. | |
| void | setType (QString stretchType) |
| Set the type of Stretch. | |
| QString | getName () const |
| Get the Stretch name. | |
| void | setName (QString name) |
| Set the Stretch name. | |
| int | getBandNumber () const |
| Get the band number for the stretch. | |
| void | setBandNumber (int bandNumber) |
| Set the band number for the stretch. | |
| void | AddPair (const double input, const double output) |
| Adds a stretch pair to the list of pairs. | |
| void | SetNull (const double value) |
| Sets the mapping for NULL pixels. | |
| void | SetLis (const double value) |
| Sets the mapping for LIS pixels. | |
| void | SetLrs (const double value) |
| Sets the mapping for LRS pixels. | |
| void | SetHis (const double value) |
| Sets the mapping for HIS pixels. | |
| void | SetHrs (const double value) |
| Sets the mapping for HRS pixels. | |
| 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. | |
| void | Load (QString &file, QString &grpName) |
| Loads the stretch pairs from the pvl file into the Stretch object. | |
| 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. | |
| double | Map (const double value) const |
| Maps an input value to an output value based on the stretch pairs and/or special pixel mappings. | |
| 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. | |
| 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. | |
| QString | Text () const |
| Converts stretch pair to a string. | |
| int | Pairs () const |
| Returns the number of stretch pairs. | |
| double | Input (const int index) const |
| Returns the value of the input side of the stretch pair at the specified index. | |
| double | Output (const int index) const |
| Returns the value of the output side of the stretch pair at the specified index. | |
| void | ClearPairs () |
| Clears the stretch pairs. | |
| void | CopyPairs (const Stretch &other) |
| Copies the stretch pairs from another Stretch object, but maintains special pixel values. | |
Private Member Functions | |
| std::pair< double, double > | NextPair (QString &pairs) |
| Given a string containing stretch pairs for example "0:0 50:0 100:255 255:255" evaluate the first pair and return a pair of doubles where first is the first input and second is the first output. | |
Private Attributes | |
| QString | m_name |
| QString | m_type |
| The name of the stretch. | |
| int | m_bandNumber |
| Type of stretch. This is only currently used in the AdvancedStretchTool. | |
| std::vector< double > | p_input |
| Array for input side of stretch pairs. | |
| std::vector< double > | p_output |
| Array for output side of stretch pairs. | |
| int | p_pairs |
| Number of stretch pairs. | |
| double | p_null |
| Mapping of input NULL values go to this value (default NULL) | |
| double | p_lis |
| Mapping of input LIS values go to this value (default LIS) | |
| double | p_lrs |
| Mapping of input LRS values go to this value (default LRS) | |
| double | p_his |
| Mapping of input HIS values go to this value (default HIS) | |
| double | p_hrs |
| Mapping of input HRS values go to this value (default HRS) | |
| double | p_minimum |
| By default this value is set to p_lrs. | |
| double | p_maximum |
| By default this value is set to p_hrs. | |
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)
Definition at line 27 of file CubeStretch.h.
| 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 |
Definition at line 19 of file CubeStretch.cpp.
| Isis::CubeStretch::CubeStretch | ( | CubeStretch const & | stretch | ) |
Copy constructor for a CubeStretch.
Definition at line 27 of file CubeStretch.cpp.
References getBandNumber(), getName(), getType(), m_bandNumber, and m_type.
| Isis::CubeStretch::CubeStretch | ( | Stretch const & | stretch | ) |
Constructs a CubeStretch object from a normal Stretch.
| Stretch | Stretch to construct the CubeStretch from. |
Definition at line 39 of file CubeStretch.cpp.
References m_bandNumber, and m_type.
| Isis::CubeStretch::CubeStretch | ( | Stretch const & | stretch, |
| QString | stretchType ) |
Constructs a CubeStretch object from a normal Stretch.
| Stretch | Stretch to construct the CubeStretch from. |
Definition at line 51 of file CubeStretch.cpp.
References m_bandNumber.
| Isis::CubeStretch::CubeStretch | ( | Blob | blob | ) |
Constructs a CubeStretch from a Blob.
| blob | The Blob to read data from. |
Definition at line 62 of file CubeStretch.cpp.
References Isis::Stretch::Parse(), setBandNumber(), setName(), and setType().
| Isis::CubeStretch::~CubeStretch | ( | ) |
Definition at line 73 of file CubeStretch.cpp.
|
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 |
Definition at line 48 of file Stretch.cpp.
References Isis::Stretch::p_input, Isis::Stretch::p_output, Isis::Stretch::p_pairs, and Isis::IException::Programmer.
Referenced by Isis::SawtoothStretchType::calculateNewStretch(), Isis::StretchTool::changeStretch(), Isis::ChipViewport::computeStretch(), Isis::LinearStretchType::endEditChanged(), Isis::GaussianStretch::GaussianStretch(), Isis::MosaicSceneItem::getStretch(), Isis::Stretch::Load(), Isis::Stretch::Parse(), Isis::Stretch::Parse(), Isis::VisualDisplay::setPixelData(), Isis::BinaryStretchType::setStretch(), Isis::StretchTool::setStretchAcrossBands(), Isis::LinearStretchType::startEditChanged(), Isis::StretchTool::stretchBand(), and Isis::StretchTool::stretchBuffer().
|
inlineinherited |
Clears the stretch pairs.
Definition at line 170 of file Stretch.h.
References Isis::Stretch::p_input, Isis::Stretch::p_output, and Isis::Stretch::p_pairs.
Referenced by Isis::StretchTool::advancedStretchChanged(), Isis::StretchTool::changeStretch(), Isis::ChipViewport::computeStretch(), Isis::GaussianStretch::GaussianStretch(), Isis::VisualDisplay::setPixelData(), Isis::StretchTool::setStretchAcrossBands(), Isis::StretchTool::stretchBand(), and Isis::StretchTool::stretchRect().
|
inherited |
Copies the stretch pairs from another Stretch object, but maintains special pixel values.
| other | - The Stretch to copy pairs from |
Definition at line 392 of file Stretch.cpp.
References Isis::Stretch::p_input, Isis::Stretch::p_output, and Isis::Stretch::p_pairs.
Referenced by Isis::StretchTool::advancedStretchChanged(), Isis::BinaryStretchType::endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::StretchTool::loadStretchFromCube(), Isis::SawtoothStretchType::offsetEditChanged(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::ManualStretchType::setStretch(), Isis::SawtoothStretchType::setStretch(), Isis::BinaryStretchType::startEditChanged(), Isis::LinearStretchType::startEditChanged(), Isis::StretchTool::stretchRequested(), and Isis::SawtoothStretchType::widthEditChanged().
| int Isis::CubeStretch::getBandNumber | ( | ) | const |
Get the band number for the stretch.
Definition at line 155 of file CubeStretch.cpp.
References m_bandNumber.
Referenced by CubeStretch(), operator==(), and toBlob().
| QString Isis::CubeStretch::getName | ( | ) | const |
Get the Stretch name.
Definition at line 145 of file CubeStretch.cpp.
Referenced by CubeStretch(), operator==(), and toBlob().
| QString Isis::CubeStretch::getType | ( | ) | const |
Get the Type of Stretch.
Definition at line 115 of file CubeStretch.cpp.
References m_type.
Referenced by CubeStretch(), 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 |
Definition at line 287 of file Stretch.cpp.
References Isis::Stretch::p_input, and Isis::Stretch::p_pairs.
Referenced by Isis::LinearStretchType::endEditChanged(), Isis::HistogramWidget::setStretch(), Isis::LinearStretchType::setStretch(), Isis::LinearStretchType::startEditChanged(), Isis::StretchTool::stretchChanged(), 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 |
Definition at line 342 of file Stretch.cpp.
References Isis::Stretch::AddPair(), Isis::toDouble(), Isis::PvlObject::Traverse, and Isis::IException::User.
Referenced by Isis::Stretch::Load().
|
inherited |
Loads the stretch pairs from the pvl file into the Stretch object.
The file should look similar to this:
| file | - The input file containing the stretch pairs |
| grpName | - The group name to get the input and output keywords from |
Definition at line 323 of file Stretch.cpp.
References Isis::Stretch::Load().
|
inherited |
Maps an input value to an output value based on the stretch pairs and/or special pixel mappings.
| value | Value to map |
Definition at line 69 of file Stretch.cpp.
References Isis::IsHisPixel(), Isis::IsHrsPixel(), Isis::IsLisPixel(), Isis::IsNullPixel(), Isis::IsValidPixel(), Isis::Stretch::p_his, Isis::Stretch::p_hrs, Isis::Stretch::p_input, Isis::Stretch::p_lis, Isis::Stretch::p_lrs, Isis::Stretch::p_maximum, Isis::Stretch::p_minimum, Isis::Stretch::p_null, Isis::Stretch::p_output, and Isis::Stretch::p_pairs.
Referenced by Isis::MosaicSceneItem::drawImage(), Isis::GaussianStretch::Map(), Isis::ChipViewport::paintImage(), Isis::VisualDisplay::paintPixmap(), and Isis::CubeViewport::paintPixmap().
|
privateinherited |
Given a string containing stretch pairs for example "0:0 50:0 100:255 255:255" evaluate the first pair and return a pair of doubles where first is the first input and second is the first output.
| pairs | A string containing stretch pairs for example "0:0 50:0 100:255 255:255" |
| Isis::IException::User | - invalid stretch pair |
Definition at line 145 of file Stretch.cpp.
References Isis::Null, and Isis::toDouble().
Referenced by Isis::Stretch::Parse(), and Isis::Stretch::Parse().
| bool Isis::CubeStretch::operator== | ( | CubeStretch & | stretch2 | ) |
Check if the CubeStretches are equal.
| stretch2 | The stretch to compare with |
Definition at line 103 of file CubeStretch.cpp.
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 |
Definition at line 302 of file Stretch.cpp.
References Isis::Stretch::p_output, and Isis::Stretch::p_pairs.
Referenced by Isis::HistogramWidget::setStretch(), and Isis::StretchType::updateTable().
|
inlineinherited |
Returns the number of stretch pairs.
Definition at line 162 of file Stretch.h.
References Isis::Stretch::p_pairs.
Referenced by Isis::HistogramWidget::setStretch(), Isis::CubeViewport::stretchBlue(), Isis::StretchTool::stretchBuffer(), Isis::StretchTool::stretchChanged(), 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 |
Definition at line 181 of file Stretch.cpp.
References Isis::Stretch::AddPair(), Isis::Stretch::NextPair(), Isis::Stretch::p_input, Isis::Stretch::p_output, Isis::Stretch::p_pairs, and Isis::IException::User.
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 |
Definition at line 218 of file Stretch.cpp.
References Isis::Stretch::AddPair(), Isis::Stretch::NextPair(), Isis::Stretch::p_input, Isis::Stretch::p_output, Isis::Stretch::p_pairs, and Isis::IException::User.
|
inherited |
Definition at line 373 of file Stretch.cpp.
|
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. |
Definition at line 367 of file Stretch.cpp.
| void Isis::CubeStretch::setBandNumber | ( | int | bandNumber | ) |
Set the band number for the stretch.
| int | band number |
Definition at line 165 of file CubeStretch.cpp.
References m_bandNumber.
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 |
Definition at line 127 of file Stretch.h.
References Isis::Stretch::p_his.
Referenced by Isis::SpecialPixelTool::apply(), Isis::MosaicSceneItem::getStretch(), 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 |
Definition at line 138 of file Stretch.h.
References Isis::Stretch::p_hrs.
Referenced by Isis::SpecialPixelTool::apply(), Isis::MosaicSceneItem::getStretch(), 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 |
Definition at line 105 of file Stretch.h.
References Isis::Stretch::p_lis.
Referenced by Isis::SpecialPixelTool::apply(), Isis::MosaicSceneItem::getStretch(), 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 |
Definition at line 116 of file Stretch.h.
References Isis::Stretch::p_lrs.
Referenced by Isis::SpecialPixelTool::apply(), Isis::MosaicSceneItem::getStretch(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
|
inlineinherited |
|
inlineinherited |
| void Isis::CubeStretch::setName | ( | QString | name | ) |
Set the Stretch name.
| QString | name for stretch |
Definition at line 135 of file CubeStretch.cpp.
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 |
Definition at line 94 of file Stretch.h.
References Isis::Stretch::p_null.
Referenced by Isis::SpecialPixelTool::apply(), Isis::MosaicSceneItem::getStretch(), Isis::QStretch::QStretch(), and Isis::VisualDisplay::VisualDisplay().
| void Isis::CubeStretch::setType | ( | QString | stretchType | ) |
Set the type of Stretch.
| QString | Type of Stretch. |
Definition at line 125 of file CubeStretch.cpp.
References m_type.
Referenced by CubeStretch().
|
inherited |
Converts stretch pair to a string.
Definition at line 268 of file Stretch.cpp.
References Isis::Stretch::p_input, Isis::Stretch::p_output, Isis::Stretch::p_pairs, and Isis::toString().
Referenced by Isis::BinaryStretchType::endEditChanged(), Isis::LinearStretchType::endEditChanged(), Isis::SawtoothStretchType::offsetEditChanged(), operator==(), Isis::StretchType::savePairs(), Isis::BinaryStretchType::setStretch(), Isis::LinearStretchType::setStretch(), Isis::ManualStretchType::setStretch(), Isis::BinaryStretchType::startEditChanged(), Isis::LinearStretchType::startEditChanged(), toBlob(), and Isis::SawtoothStretchType::widthEditChanged().
| 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.
Definition at line 84 of file CubeStretch.cpp.
References getBandNumber(), getName(), getType(), and Isis::Stretch::Text().
Referenced by Isis::StretchTool::saveStretchToCube().
|
private |
Type of stretch. This is only currently used in the AdvancedStretchTool.
Definition at line 53 of file CubeStretch.h.
Referenced by CubeStretch(), CubeStretch(), CubeStretch(), getBandNumber(), and setBandNumber().
|
private |
Definition at line 51 of file CubeStretch.h.
|
private |
The name of the stretch.
Definition at line 52 of file CubeStretch.h.
Referenced by CubeStretch(), CubeStretch(), getType(), and setType().
|
privateinherited |
Mapping of input HIS values go to this value (default HIS)
Definition at line 70 of file Stretch.h.
Referenced by Isis::Stretch::Map(), Isis::Stretch::SetHis(), and Isis::Stretch::Stretch().
|
privateinherited |
Mapping of input HRS values go to this value (default HRS)
Definition at line 72 of file Stretch.h.
Referenced by Isis::Stretch::Map(), Isis::Stretch::SetHrs(), and Isis::Stretch::Stretch().
|
privateinherited |
Array for input side of stretch pairs.
Definition at line 60 of file Stretch.h.
Referenced by Isis::Stretch::AddPair(), Isis::Stretch::ClearPairs(), Isis::Stretch::CopyPairs(), Isis::Stretch::Input(), Isis::Stretch::Map(), Isis::Stretch::Parse(), Isis::Stretch::Parse(), and Isis::Stretch::Text().
|
privateinherited |
Mapping of input LIS values go to this value (default LIS)
Definition at line 66 of file Stretch.h.
Referenced by Isis::Stretch::Map(), Isis::Stretch::SetLis(), and Isis::Stretch::Stretch().
|
privateinherited |
Mapping of input LRS values go to this value (default LRS)
Definition at line 68 of file Stretch.h.
Referenced by Isis::Stretch::Map(), Isis::Stretch::SetLrs(), and Isis::Stretch::Stretch().
|
privateinherited |
By default this value is set to p_hrs.
Definition at line 75 of file Stretch.h.
Referenced by Isis::Stretch::Map(), and Isis::Stretch::Stretch().
|
privateinherited |
By default this value is set to p_lrs.
Definition at line 74 of file Stretch.h.
Referenced by Isis::Stretch::Map(), and Isis::Stretch::Stretch().
|
privateinherited |
Mapping of input NULL values go to this value (default NULL)
Definition at line 64 of file Stretch.h.
Referenced by Isis::Stretch::Map(), Isis::Stretch::SetNull(), and Isis::Stretch::Stretch().
|
privateinherited |
Array for output side of stretch pairs.
Definition at line 61 of file Stretch.h.
Referenced by Isis::Stretch::AddPair(), Isis::Stretch::ClearPairs(), Isis::Stretch::CopyPairs(), Isis::Stretch::Map(), Isis::Stretch::Output(), Isis::Stretch::Parse(), Isis::Stretch::Parse(), and Isis::Stretch::Text().
|
privateinherited |
Number of stretch pairs.
Definition at line 62 of file Stretch.h.
Referenced by Isis::Stretch::AddPair(), Isis::Stretch::ClearPairs(), Isis::Stretch::CopyPairs(), Isis::Stretch::Input(), Isis::Stretch::Map(), Isis::Stretch::Output(), Isis::Stretch::Pairs(), Isis::Stretch::Parse(), Isis::Stretch::Parse(), Isis::Stretch::Stretch(), and Isis::Stretch::Text().