File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis Developer Reference
Image.h
Go to the documentation of this file.
1 
2 #ifndef Image_H
3 #define Image_H
4 
26 #include <QObject>
27 
28 #include <QString>
29 
30 #include "Angle.h"
31 #include "Distance.h"
32 #include "FileName.h"
33 #include "XmlStackedHandler.h"
34 
35 #include <SpiceUsr.h>
36 #include <SpiceZfc.h>
37 #include <SpiceZmc.h>
38 
39 class QUuid;
40 class QMutex;
41 class QXmlStreamWriter;
42 
43 namespace geos {
44  namespace geom {
45  class MultiPolygon;
46  }
47 }
48 
49 namespace Isis {
50  class Cube;
51  class FileName;
52  class ImageDisplayProperties;
53  class Project;
54  class PvlObject;
55  class XmlStackedHandlerReader;
56 
107  class Image : public QObject {
108  Q_OBJECT
109  public:
110  explicit Image(QString imageFileName, QObject *parent = 0);
111  explicit Image(Cube *imageCube, QObject *parent = 0);
112  explicit Image(Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id,
113  QObject *parent = 0);
114  Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
115  ~Image();
116 
117  void fromPvl(const PvlObject &pvl);
118  PvlObject toPvl() const;
119 
120  bool isFootprintable() const;
121  Cube *cube();
122  void closeCube();
125  QString fileName() const;
126  QString observationNumber();
127  QString serialNumber();
128  geos::geom::MultiPolygon *footprint();
129  const geos::geom::MultiPolygon *footprint() const;
130  void setId(QString id);
131 
132  bool initFootprint(QMutex *cameraMutex);
133 
134  double aspectRatio() const;
135  QString id() const;
136  double resolution() const;
137  Angle emissionAngle() const;
138  Angle incidenceAngle() const;
139  double lineResolution() const;
140  Distance localRadius() const;
141  Angle northAzimuth() const;
142  Angle phaseAngle() const;
143  double sampleResolution() const;
144 
145  void copyToNewProjectRoot(const Project *project, FileName newProjectRoot);
146  void deleteFromDisk();
147  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
148 
149  public slots:
150  void updateFileName(Project *);
151 
152  private:
153  geos::geom::MultiPolygon *createFootprint(QMutex *cameraMutex);
154  void initCamStats();
155  void initQuickFootprint();
156 
157 
158  private:
172  class XmlHandler : public XmlStackedHandler {
173  public:
174  XmlHandler(Image *image, FileName imageFolder);
175 
176  virtual bool startElement(const QString &namespaceURI, const QString &localName,
177  const QString &qName, const QXmlAttributes &atts);
178  virtual bool characters(const QString &ch);
179  virtual bool endElement(const QString &namespaceURI, const QString &localName,
180  const QString &qName);
181 
182  private:
183  Q_DISABLE_COPY(XmlHandler);
184 
185  Image *m_image;
186  FileName m_imageFolder;
187  QString m_characters;
188 
189  };
190 
191  private:
192  Image(const Image &other);
193  Image &operator=(const Image &rhs);
194 
195  SpiceInt *m_bodyCode;
199  // QString *m_name; //!< Name of the target
200 
201 
206  Cube *m_cube;
207 
211  ImageDisplayProperties *m_displayProperties;
212 
216  QString m_fileName;
217 
221  QString m_instrumentId;
222 
226  QString m_observationNumber;
227 
231  QString m_serialNumber;
232 
236  QString m_spacecraftName;
237 
241  geos::geom::MultiPolygon *m_footprint;
245  QUuid *m_id;
246 
247  double m_aspectRatio;
248  double m_resolution;
249  Angle m_emissionAngle;
250  Angle m_incidenceAngle;
251  double m_lineResolution;
252  double m_sampleResolution;
253  Distance m_localRadius;
254  Angle m_northAzimuth;
255  Angle m_phaseAngle;
256 
257  };
258  // TODO: add QDataStream >> and << ???
259 }
260 
262 
263 #endif
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
FileName.h
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
Cube.h
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::IException::print
void print() const
Prints a string representation of this exception to stderr.
Definition: IException.cpp:445
Isis::DisplayProperties::fromPvl
void fromPvl(const PvlObject &pvl)
Definition: DisplayProperties.cpp:54
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Project.h
Isis::Image::serialNumber
QString serialNumber()
Returns the serial number of the Cube.
Definition: Image.cpp:361
Isis::Blob::Type
QString Type() const
Accessor method that returns a string containing the Blob type.
Definition: Blob.cpp:124
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::Image::lineResolution
double lineResolution() const
Get the line resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:485
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
geos
Definition: Image.h:43
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::Cube::readFootprint
ImagePolygon readFootprint() const
Read the footprint polygon for the Cube.
Definition: Cube.cpp:866
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::ImagePolygon::toBlob
Blob toBlob() const
Serialize the ImagePolygon to a Blob.
Definition: ImagePolygon.cpp:1347
Target.h
Isis::SerialNumber::Compose
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Definition: SerialNumber.cpp:38
Isis::Cube::copy
Cube * copy(FileName newFile, const CubeAttributeOutput &newFileAttributes)
Copies the cube to the new fileName.
Definition: Cube.cpp:276
ImageDisplayProperties.h
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ImagePolygon::Create
void Create(Cube &cube, int sinc=1, int linc=1, int ss=1, int sl=1, int ns=0, int nl=0, int band=1, bool increasePrecision=false)
Create a Polygon from given cube.
Definition: ImagePolygon.cpp:217
Isis::Image::initFootprint
bool initFootprint(QMutex *cameraMutex)
Calculate a footprint for this image.
Definition: Image.cpp:409
Isis::PvlObject::objects
int objects() const
Returns the number of objects.
Definition: PvlObject.h:219
Isis::CubeAttributeOutput
Manipulate and parse attributes of output cube filenames.
Definition: CubeAttribute.h:473
Isis::globalFactory
static geos::geom::GeometryFactory::Ptr globalFactory
Definition: PolygonTools.h:51
Isis::Image::fileName
QString fileName() const
Get the file name of the cube that this image represents.
Definition: Image.cpp:340
Image.h
Isis::ImagePolygon
Create cube polygons, read/write polygons to blobs.
Definition: ImagePolygon.h:153
Isis::Image::phaseAngle
Angle phaseAngle() const
Get the phase angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:515
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
Isis::Project::imageDataRoot
QString imageDataRoot() const
Accessor for the root directory of the image data.
Definition: Project.cpp:2077
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
Isis::Blob::Name
QString Name() const
Accessor method that returns a string containing the Blob name.
Definition: Blob.cpp:133
IString.h
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::Image::resolution
double resolution() const
Get the resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:455
Isis::Image::localRadius
Distance localRadius() const
Get the local radius of this image, as calculated and attached by camstats.
Definition: Image.cpp:495
Isis::Cube::externalCubeFileName
FileName externalCubeFileName() const
If this is an external cube label file, this will give you the cube dn file that this label reference...
Definition: Cube.cpp:1535
ObservationNumber.h
Isis::Image::deleteFromDisk
void deleteFromDisk()
Delete the image data from disk.
Definition: Image.cpp:586
Isis::Image::aspectRatio
double aspectRatio() const
Get the aspect ratio of this image, as calculated and attached by camstats.
Definition: Image.cpp:436
Isis::ReadWrite
const int ReadWrite
Definition: Process.h:24
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::Image *)
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::Image::northAzimuth
Angle northAzimuth() const
Get the north azimuth of this image, as calculated and attached by camstats.
Definition: Image.cpp:505
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::FileName::dir
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
Definition: FileName.cpp:465
Isis::PvlContainer::isNamed
bool isNamed(const QString &match) const
Returns whether the given string is equal to the container name or not.
Definition: PvlContainer.h:72
Isis::Image::save
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Image properties out to an XML file.
Definition: Image.cpp:626
Isis::PvlObject::hasKeyword
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
DisplayProperties.h
Isis::Image::footprint
geos::geom::MultiPolygon * footprint()
Get the footprint of this image (if available).
Definition: Image.cpp:374
Isis::Image::cube
Cube * cube()
Get the Cube pointer associated with this display property.
Definition: Image.cpp:287
Isis::PvlObject::findObject
PvlObjectIterator findObject(const QString &name, PvlObjectIterator beg, PvlObjectIterator end)
Find the index of object with a specified name, between two indexes.
Definition: PvlObject.h:274
Isis::Distance::isValid
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:192
Isis::Cube::sampleCount
int sampleCount() const
Definition: Cube.cpp:1807
Isis::Image::closeCube
void closeCube()
Cleans up the Cube pointer.
Definition: Image.cpp:307
Isis::Project::newProjectRoot
QString newProjectRoot() const
Get the top-level folder of the new project.
Definition: Project.cpp:1675
Isis::DisplayProperties::displayName
QString displayName() const
Returns the display name.
Definition: DisplayProperties.cpp:88
Isis::Image::fromPvl
void fromPvl(const PvlObject &pvl)
Read the image settings from a Pvl.
Definition: Image.cpp:194
Isis::ObservationNumber::Compose
static QString Compose(Pvl &label, bool def2filename=false)
Compose a ObservationNumber from a PVL.
Definition: ObservationNumber.cpp:31
Isis::Image::isFootprintable
bool isFootprintable() const
Test to see if it's possible to create a footprint from this image.
Definition: Image.cpp:253
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::Image::sampleResolution
double sampleResolution() const
Get the sample resolution of this image, as calculated and attached by camstats.
Definition: Image.cpp:525
Isis::Image::copyToNewProjectRoot
void copyToNewProjectRoot(const Project *project, FileName newProjectRoot)
Copy the cub/ecub files associated with this image into the new project.
Definition: Image.cpp:534
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Angle
Defines an angle and provides unit conversions.
Definition: Angle.h:45
Isis::FileName::toString
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
Definition: FileName.cpp:515
Isis::Project::projectRoot
QString projectRoot() const
Get the top-level folder of the project.
Definition: Project.cpp:1666
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::Image::updateFileName
void updateFileName(Project *)
Change the on-disk file name for this cube to be where the image ought to be in the given project.
Definition: Image.cpp:691
Isis::Image::Image
Image(QString imageFileName, QObject *parent=0)
Create an image from a cube file on disk.
Definition: Image.cpp:42
Isis::Image::displayProperties
ImageDisplayProperties * displayProperties()
Get the display (GUI) properties (information) associated with this image.
Definition: Image.cpp:320
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::PolygonTools::MakeMultiPolygon
static geos::geom::MultiPolygon * MakeMultiPolygon(const geos::geom::Geometry *geom)
Make a geos::geom::MultiPolygon out of the components of the argument.
Definition: PolygonTools.cpp:1369
Isis::Angle::isValid
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Definition: Angle.cpp:95
Isis::Cube::storesDnData
bool storesDnData() const
This method returns a boolean value.
Definition: Cube.cpp:1904
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::Image::id
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:445
Isis::DisplayProperties::toPvl
PvlObject toPvl() const
Convert to Pvl for project files.
Definition: DisplayProperties.cpp:68
Angle.h
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::Image::toPvl
PvlObject toPvl() const
Convert this Image to PVL.
Definition: Image.cpp:226
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
PolygonTools.h
QObject
Distance.h
Isis::Image::incidenceAngle
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:475
Isis::DisplayProperties::save
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
Definition: DisplayProperties.cpp:159
Isis::Image::emissionAngle
Angle emissionAngle() const
Get the emission angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:465
Isis::FileName::setExtension
FileName setExtension(const QString &extension) const
Sets all current file extensions to a new extension in the file name.
Definition: FileName.cpp:265
Isis::Blob
Definition: Blob.h:51
SerialNumber.h
Isis::Image::observationNumber
QString observationNumber()
Returns the observation number of the Cube.
Definition: Image.cpp:349
XmlStackedHandlerReader.h
Isis::Project::imageDataRoot
static QString imageDataRoot(QString projectRoot)
Appends the root directory name 'images' to the project .
Definition: Project.cpp:2067
XmlStackedHandler.h
Isis::Image::~Image
~Image()
Clean up this image.
Definition: Image.cpp:161
Isis::ImagePolygon::Polys
geos::geom::MultiPolygon * Polys()
Return a geos Multipolygon.
Definition: ImagePolygon.h:210
CubeAttribute.h
Isis::Image::setId
void setId(QString id)
Override the automatically generated ID with the given ID.
Definition: Image.cpp:383
Isis::FileName::path
QString path() const
Returns the path of the file name.
Definition: FileName.cpp:103
Isis::Angle::Radians
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
Definition: Angle.h:63
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IString::ToQt
QString ToQt() const
Retuns the object string as a QString.
Definition: IString.cpp:869
ImagePolygon.h
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::ImageDisplayProperties
This is the GUI communication mechanism for cubes.
Definition: ImageDisplayProperties.h:85
Isis::Angle::radians
double radians() const
Convert an angle to a double.
Definition: Angle.h:226

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:11:18