99 vector<QString> result;
101 QString str =
toString().remove(QRegExp(
"^\\+"));
103 QStringList strSplit = str.split(
",", QString::SkipEmptyParts);
104 foreach (QString commaTok, strSplit) {
106 if (commaTok.contains(
'-')) {
108 int start =
toInt(commaTok.mid(0, commaTok.indexOf(
"-")));
109 int end =
toInt(commaTok.mid(commaTok.indexOf(
"-") + 1));
111 direction = (start <= end) ? 1 : -1;
113 for (
int band = start; band != end; band += direction) {
120 result.push_back(commaTok);
138 bool CubeAttributeInput::isBandRange(QString attribute)
const {
139 return QRegExp(
"[0-9,\\-]+").exactMatch(attribute);
145 for (
unsigned int i = 0; i <
bands.size(); i++) {
159 result.append(&CubeAttributeInput::isBandRange);
186 if (pixelTypeAtts.isEmpty() || pixelTypeAtts.last() ==
"PROPAGATE")
194 return attributeList(&CubeAttributeOutput::isRange).isEmpty();
288 if (!formatList.isEmpty()) {
289 QString formatString = formatList.last();
291 if (formatString ==
"BSQ" || formatString ==
"BANDSEQUENTIAL")
306 &CubeAttributeOutput::isFileFormat);
311 double result =
Null;
314 QString range =
attributeList(&CubeAttributeOutput::isRange).last();
317 if (rangeList.count() == 2 && rangeList.first() !=
"")
318 result =
toDouble(rangeList.first());
326 double result =
Null;
329 QString range =
attributeList(&CubeAttributeOutput::isRange).last();
332 if (rangeList.count() == 2 && rangeList.last() !=
"")
333 result =
toDouble(rangeList.last());
380 QString pixelTypeAtt =
attributeList(&CubeAttributeOutput::isPixelType).last();
382 if (pixelTypeAtt ==
"8BIT" || pixelTypeAtt ==
"8-BIT" || pixelTypeAtt ==
"UNSIGNEDBYTE") {
383 result = UnsignedByte;
385 else if (pixelTypeAtt ==
"16BIT" || pixelTypeAtt ==
"16-BIT" || pixelTypeAtt ==
"SIGNEDWORD") {
388 else if (pixelTypeAtt ==
"16UBIT" || pixelTypeAtt ==
"16-UBIT" || pixelTypeAtt ==
"UNSIGNEDWORD") {
389 result = UnsignedWord;
391 else if (pixelTypeAtt ==
"32BIT" || pixelTypeAtt ==
"32-BIT" || pixelTypeAtt ==
"REAL") {
394 else if (pixelTypeAtt ==
"32UINT" || pixelTypeAtt ==
"32-UINT" || pixelTypeAtt ==
"UNSIGNEDINTEGER") {
395 result = UnsignedInteger;
397 else if (pixelTypeAtt ==
"32INT" || pixelTypeAtt ==
"32-INT" || pixelTypeAtt ==
"SIGNEDINTEGER") {
398 result = SignedInteger;
420 if (!labelAttachmentAtts.isEmpty()) {
421 QString labelAttachmentAtt = labelAttachmentAtts.last();
423 if (labelAttachmentAtt ==
"DETACHED")
425 else if (labelAttachmentAtt ==
"EXTERNAL")
433 bool CubeAttributeOutput::isByteOrder(QString attribute)
const {
434 return QRegExp(
"(M|L)SB").exactMatch(attribute);
438 bool CubeAttributeOutput::isFileFormat(QString attribute)
const {
439 return QRegExp(
"(BANDSEQUENTIAL|BSQ|TILE)").exactMatch(attribute);
443 bool CubeAttributeOutput::isLabelAttachment(QString attribute)
const {
444 return QRegExp(
"(ATTACHED|DETACHED|EXTERNAL)").exactMatch(attribute);
448 bool CubeAttributeOutput::isPixelType(QString attribute)
const {
449 QString expressions =
"(8-?BIT|16-?BIT|32-?BIT|UNSIGNEDBYTE|SIGNEDWORD|UNSIGNEDWORD|REAL";
450 expressions +=
"|32-?UINT|32-?INT|UNSIGNEDINTEGER|SIGNEDINTEGER)";
451 return QRegExp(expressions).exactMatch(attribute);
456 bool CubeAttributeOutput::isRange(QString attribute)
const {
457 return QRegExp(
"[\\-+E0-9.]*:[\\-+E0-9.]*").exactMatch(attribute);
462 QString result =
"Tile";
465 result =
"BandSequential";
476 if (!byteOrderAtts.isEmpty()) {
477 QString byteOrderAtt = byteOrderAtts.last();
478 result = (byteOrderAtt ==
"LSB")? Lsb : Msb;
492 &CubeAttributeOutput::isByteOrder);
499 result.append(&CubeAttributeOutput::isByteOrder);
500 result.append(&CubeAttributeOutput::isFileFormat);
501 result.append(&CubeAttributeOutput::isLabelAttachment);
502 result.append(&CubeAttributeOutput::isPixelType);
503 result.append(&CubeAttributeOutput::isRange);
The label is pointing to an external DN file - the label is also external to the data.
const double Null
Value for an Isis Null pixel.
PixelType pixelType() const
Return the pixel type as an Isis::PixelType.
ByteOrder byteOrder() const
Return the byte order as an Isis::ByteOrder.
File name manipulation and expansion.
int toInt(const QString &string)
Global function to convert from a string to an integer.
QString PixelTypeName(Isis::PixelType pixelType)
Returns string name of PixelType enumeration entered as input parameter.
Namespace for the standard library.
ByteOrder
Tests the current architecture for byte order.
bool propagatePixelType() const
Return true if the pixel type is to be propagated from an input cube.
void setAttributes(const FileName &fileName)
Replaces the current attributes with the attributes in the given file name.
bool propagateMinimumMaximum() const
Return true if the min/max are to be propagated from an input cube.
void setLabelAttachment(LabelAttachment attachment)
Set the label attachment type to the parameter value.
void setFileFormat(Cube::Format fmt)
Set the format to the fmt parameter.
QString byteOrderString() const
Return the byte order as a string.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
double toDouble(const QString &string)
Global function to convert from a string to a double.
PixelType
Enumerations for Isis Pixel Types.
CubeAttributeOutput()
Constructs an empty CubeAttributeOutput.
The input label is in a separate data file from the image.
Cubes are stored in tile format, that is the order of the pixels in the file (on disk) is BSQ within ...
void setAttribute(QString newValue, bool(CubeAttributeOutput ::*tester)(QString) const)
Set the attribute(s) for which tester returns true to newValue.
Manipulate and parse attributes of output cube filenames.
bool IsLsb()
Return true if this host is an LSB first machine and false if it is not.
QString LabelAttachmentName(LabelAttachment labelType)
Return the string representation of the contents of a variable of type LabelAttachment.
double maximum() const
Return the output cube attribute maximum.
bool IsSpecial(const double d)
Returns if the input pixel is special.
The input label is embedded in the image file.
Cube::Format fileFormat() const
Return the file format an Cube::Format.
void setPixelType(PixelType type)
Set the pixel type to that given by the parameter.
QString fileFormatString() const
Return the file format as a string.
void setMinimum(double min)
Set the output cube attribute minimum.
Cubes are stored in band-sequential format, that is the order of the pixels in the file (on disk) is:...
~CubeAttributeOutput()
Destroys the object.
Namespace for ISIS/Bullet specific routines.
Parent class for CubeAttributeInput and CubeAttributeOutput.
double minimum() const
Return the output cube attribute minimum.
LabelAttachment
Input cube label type tracker.
Format
These are the possible storage formats of Isis3 cubes.
QString toString() const
Return a string-representation of this cube attributes.
void setByteOrder(ByteOrder order)
Set the order according to the parameter order.
void setMaximum(double max)
Set the output cube attribute maximum.
QStringList attributeList(bool(CubeAttributeOutput ::*tester)(QString) const) const
Get a list of attributes that the tester returns true on.