Isis 3 Programmer Reference
Image.cpp
1 #include "Image.h"
2 
3 #include <QBuffer>
4 #include <QDataStream>
5 #include <QDebug>
6 #include <QDir>
7 #include <QFileInfo>
8 #include <QMutexLocker>
9 #include <QScopedPointer>
10 #include <QString>
11 #include <QUuid>
12 #include <QXmlStreamWriter>
13 
14 #include <geos/geom/MultiPolygon.h>
15 #include <geos/io/WKTReader.h>
16 #include <geos/io/WKTWriter.h>
17 
18 #include "Angle.h"
19 #include "Cube.h"
20 #include "CubeAttribute.h"
21 #include "DisplayProperties.h"
22 #include "Distance.h"
23 #include "FileName.h"
24 #include "ImageDisplayProperties.h"
25 #include "ImagePolygon.h"
26 #include "IString.h"
27 #include "ObservationNumber.h"
28 #include "PolygonTools.h"
29 #include "Project.h"
30 #include "SerialNumber.h"
31 #include "Target.h"
32 #include "XmlStackedHandlerReader.h"
33 
34 
35 namespace Isis {
36 
42  Image::Image(QString imageFileName, QObject *parent) : QObject(parent) {
43  m_bodyCode = NULL;
44  m_cube = NULL;
45  m_displayProperties = NULL;
46  m_footprint = NULL;
47  m_id = NULL;
48 
53 
54  m_fileName = imageFileName;
55 
56  cube();
57 
58  initCamStats();
59 
60  try {
62  }
63  catch (IException &) {
64  }
65 
67 
68  m_id = new QUuid(QUuid::createUuid());
69  }
70 
71 
77  Image::Image(Cube *imageCube, QObject *parent) : QObject(parent) {
78  m_fileName = imageCube->fileName();
79 
80  m_bodyCode = NULL;
81  m_cube = imageCube;
82  m_displayProperties = NULL;
83  m_footprint = NULL;
84  m_id = NULL;
85 
90 
91  initCamStats();
92 
93  try {
95  }
96  catch (IException &e) {
97  }
98 
100 
101  m_id = new QUuid(QUuid::createUuid());
102  }
103 
104 
111  Image::Image(Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id, QObject *parent) :
112  QObject(parent) {
113  m_fileName = imageCube->fileName();
114 
115  m_bodyCode = NULL;
116  m_cube = imageCube;
117  m_displayProperties = NULL;
118  m_id = NULL;
119 
121  m_resolution = Null;
124 
125  initCamStats();
126 
128 
130 
131  setId(id);
132  }
133 
134 
141  Image::Image(FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent) :
142  QObject(parent) {
143  m_bodyCode = NULL;
144  m_cube = NULL;
145  m_displayProperties = NULL;
146  m_footprint = NULL;
147  m_id = NULL;
148 
150  m_resolution = Null;
153 
154  xmlReader->pushContentHandler(new XmlHandler(this, imageFolder));
155  }
156 
157 
162  delete m_bodyCode;
163  m_bodyCode = NULL;
164 
165  delete m_cube;
166  m_cube = NULL;
167 
168  delete m_footprint;
169  m_footprint = NULL;
170 
171  delete m_id;
172  m_id = NULL;
173 
174  // Image is a "Qt" parent of display properties, so the Image QObject
175  // destructor will take care of deleting the display props. See call to
176  // DisplayProperties' constructor.
177  m_displayProperties = NULL;
178  }
179 
180 
194  void Image::fromPvl(const PvlObject &pvl) {
195  QString pvlFileName = ((IString)pvl["FileName"][0]).ToQt();
196  if (m_fileName != pvlFileName) {
198  tr("Tried to load Image [%1] with properties/information from [%2].")
199  .arg(m_fileName).arg(pvlFileName),
200  _FILEINFO_);
201  }
202 
203  displayProperties()->fromPvl(pvl.findObject("DisplayProperties"));
204 
205  if (pvl.hasKeyword("ID")) {
206  QByteArray hexValues(pvl["ID"][0].toLatin1());
207  QDataStream valuesStream(QByteArray::fromHex(hexValues));
208  valuesStream >> *m_id;
209  }
210  }
211 
212 
227  PvlObject output("Image");
228 
229  output += PvlKeyword("FileName", m_fileName);
230 
231  // Do m_id
232  QBuffer dataBuffer;
233  dataBuffer.open(QIODevice::ReadWrite);
234 
235  QDataStream idStream(&dataBuffer);
236  idStream << *m_id;
237 
238  dataBuffer.seek(0);
239 
240  output += PvlKeyword("ID", QString(dataBuffer.data().toHex()));
241 
242  output += displayProperties()->toPvl();
243 
244  return output;
245  }
246 
247 
253  bool Image::isFootprintable() const {
254  bool result = false;
255 
256  if (m_footprint) {
257  result = true;
258  }
259 
260  if (!result && m_cube) {
261  Blob example = ImagePolygon().toBlob();
262 
263  QString blobType = example.Type();
264  QString blobName = example.Name();
265 
266  Pvl &labels = *m_cube->label();
267 
268  for (int i = 0; i < labels.objects(); i++) {
269  PvlObject &obj = labels.object(i);
270 
271  if (obj.isNamed(blobType) && obj.hasKeyword("Name") && obj["Name"][0] == blobName)
272  result = true;
273  }
274  }
275 
276  return result;
277  }
278 
279 
288  if (!m_cube) {
289  try {
290  m_cube = new Cube(m_fileName);
291  }
292  catch (IException &e) {
293  throw IException(e, IException::Programmer, "Cube cannot be created", _FILEINFO_);
294  }
295  }
296 
297  return m_cube;
298  }
299 
300 
308  if (m_cube) {
309  delete m_cube;
310  m_cube = NULL;
311  }
312  }
313 
314 
321  return m_displayProperties;
322  }
323 
324 
332  return m_displayProperties;
333  }
334 
335 
340  QString Image::fileName() const {
341  return m_fileName;
342  }
343 
344 
350  if (m_observationNumber.isEmpty()) {
352  }
353  return m_observationNumber;
354  }
355 
356 
362  if (m_serialNumber.isEmpty()) {
364  }
365  return m_serialNumber;
366  }
367 
368 
374  geos::geom::MultiPolygon *Image::footprint() {
375  return m_footprint;
376  }
377 
378 
383  void Image::setId(QString id) {
384  m_id = new QUuid(id);
385  }
386 
387 
393  const geos::geom::MultiPolygon *Image::footprint() const {
394  return m_footprint;
395  }
396 
397 
409  bool Image::initFootprint(QMutex *cameraMutex) {
410  if (!m_footprint) {
411  try {
413  }
414  catch (IException &e) {
415  try {
416  m_footprint = createFootprint(cameraMutex);
417  }
418  catch (IException &e) {
419  IString msg = "Could not read the footprint from cube [" +
420  displayProperties()->displayName() + "]. Please make "
421  "sure footprintinit has been run";
422  throw IException(e, IException::Io, msg, _FILEINFO_);
423  }
424  }
425  }
426 
427  // I'm not sure how this could ever be NULL. -SL
428  return (m_footprint != NULL);
429  }
430 
431 
436  double Image::aspectRatio() const {
437  return m_aspectRatio;
438  }
439 
440 
445  QString Image::id() const {
446  return m_id->toString().remove(QRegExp("[{}]"));
447  }
448 
449 
455  double Image::resolution() const {
456  return m_resolution;
457  }
458 
459 
466  return m_emissionAngle;
467  }
468 
469 
476  return m_incidenceAngle;
477  }
478 
479 
485  double Image::lineResolution() const {
486  return m_lineResolution;
487  }
488 
489 
496  return m_localRadius;
497  }
498 
499 
506  return m_northAzimuth;
507  }
508 
509 
516  return m_phaseAngle;
517  }
518 
519 
525  double Image::sampleResolution() const {
526  return m_sampleResolution;
527  }
528 
529 
534  void Image::copyToNewProjectRoot(const Project *project, FileName newProjectRoot) {
535  if (FileName(newProjectRoot) != FileName(project->projectRoot())) {
536  Cube origImage(m_fileName);
537 
538  // The imageDataRoot will either be PROJECTROOT/images or PROJECTROOT/results/bundle/timestamp/images,
539  // depending on how the newProjectRoot points to.
540  FileName newExternalLabelFileName(Project::imageDataRoot(newProjectRoot.toString()) + "/" +
541  FileName(m_fileName).dir().dirName() + "/" + FileName(m_fileName).name());
542 
543  if (m_fileName != newExternalLabelFileName.toString()) {
544  // This cube copy creates a filename w/ecub extension in the new project root, but looks to
545  // be a cube(internal vs external). It changes the DnFile pointer to the old ecub,
546  // /tmp/tsucharski_ipce/tmpProject/images/import1/AS15-.ecub, but doing a less on file
547  // immediately after the following call indicates it is a binary file.
548  QScopedPointer<Cube> newExternalLabel(
549  origImage.copy(newExternalLabelFileName, CubeAttributeOutput("+External")));
550 
551  // If this is an ecub (it should be) and is pointing to a relative file name,
552  // then we want to copy the DN cube also.
553  if (!origImage.storesDnData() ) {
554  if (origImage.externalCubeFileName().path() == ".") {
555  Cube dnFile(
556  FileName(m_fileName).path() + "/" + origImage.externalCubeFileName().name());
557  FileName newDnFileName = newExternalLabelFileName.setExtension("cub");
558  QScopedPointer<Cube> newDnFile(dnFile.copy(newDnFileName, CubeAttributeOutput()));
559  newDnFile->close();
560  // Changes the ecube's DnFile pointer in the labels.
561  newExternalLabel->relocateDnData(newDnFileName.name());
562  }
563  else {
564  // If the the ecub's external cube is pointing to the old project root, update to new
565  // project root.
566  if (origImage.externalCubeFileName().toString().contains(project->projectRoot())) {
567  QString newExternalCubeFileName = origImage.externalCubeFileName().toString();
568  newExternalCubeFileName.replace(project->projectRoot(), project->newProjectRoot());
569  newExternalLabel->relocateDnData(newExternalCubeFileName);
570  }
571  else {
572  newExternalLabel->relocateDnData(origImage.externalCubeFileName());
573  }
574  }
575  }
576  }
577  }
578  }
579 
580 
587  bool deleteCubAlso = (cube()->externalCubeFileName().path() == ".");
588  closeCube();
589 
590  if (!QFile::remove(m_fileName)) {
592  tr("Could not remove file [%1]").arg(m_fileName),
593  _FILEINFO_);
594  }
595 
596  if (deleteCubAlso) {
597  FileName cubFile = FileName(m_fileName).setExtension("cub");
598  if (!QFile::remove(cubFile.expanded() ) ) {
600  tr("Could not remove file [%1]").arg(m_fileName),
601  _FILEINFO_);
602  }
603  }
604 
605  // If we're the last thing in the folder, remove the folder too.
606  QDir dir;
607  dir.rmdir(FileName(m_fileName).path());
608  }
609 
610 
626  void Image::save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot)
627  const {
628  stream.writeStartElement("image");
629 
630  stream.writeAttribute("id", m_id->toString());
631  stream.writeAttribute("fileName", FileName(m_fileName).name());
632  stream.writeAttribute("instrumentId", m_instrumentId);
633  stream.writeAttribute("spacecraftName", m_spacecraftName);
634 
635  if (!IsSpecial(m_aspectRatio) ) {
636  stream.writeAttribute("aspectRatio", IString(m_aspectRatio).ToQt());
637  }
638 
639  if (!IsSpecial(m_resolution) ) {
640  stream.writeAttribute("resolution", IString(m_resolution).ToQt());
641  }
642 
643  if (m_emissionAngle.isValid() ) {
644  stream.writeAttribute("emissionAngle", IString(m_emissionAngle.radians()).ToQt());
645  }
646 
647  if (m_incidenceAngle.isValid() ) {
648  stream.writeAttribute("incidenceAngle", IString(m_incidenceAngle.radians()).ToQt());
649  }
650 
651  if (!IsSpecial(m_lineResolution) ) {
652  stream.writeAttribute("lineResolution", IString(m_lineResolution).ToQt());
653  }
654 
655  if (m_localRadius.isValid() ) {
656  stream.writeAttribute("localRadius", IString(m_localRadius.meters()).ToQt());
657  }
658 
659  if (m_northAzimuth.isValid() ) {
660  stream.writeAttribute("northAzimuth", IString(m_northAzimuth.radians()).ToQt());
661  }
662 
663  if (m_phaseAngle.isValid() ) {
664  stream.writeAttribute("phaseAngle", IString(m_phaseAngle.radians()).ToQt());
665  }
666 
667  if (!IsSpecial(m_sampleResolution) ) {
668  stream.writeAttribute("sampleResolution", IString(m_sampleResolution).ToQt());
669  }
670 
671  if (m_footprint) {
672  stream.writeStartElement("footprint");
673 
674  geos::io::WKTWriter wktWriter;
675  stream.writeCharacters(QString::fromStdString(wktWriter.write(m_footprint)));
676 
677  stream.writeEndElement();
678  }
679 
680  m_displayProperties->save(stream, project, newProjectRoot);
681 
682  stream.writeEndElement();
683  }
684 
685 
692  closeCube();
693 
694  FileName original(m_fileName);
695  FileName newName(project->imageDataRoot() + "/" +
696  original.dir().dirName() + "/" + original.name());
697  m_fileName = newName.expanded();
698  }
699 
700 
706  geos::geom::MultiPolygon *Image::createFootprint(QMutex *cameraMutex) {
707  QMutexLocker lock(cameraMutex);
708 
709  // We need to walk the image to create the polygon...
710  ImagePolygon imgPoly;
711 
712  int sampleStepSize = cube()->sampleCount() / 10;
713  if (sampleStepSize <= 0) sampleStepSize = 1;
714 
715  int lineStepSize = cube()->lineCount() / 10;
716  if (lineStepSize <= 0) lineStepSize = 1;
717 
718  imgPoly.Create(*cube(), sampleStepSize, lineStepSize);
719 
721  tr("Warning: Polygon re-calculated for [%1] which can be very slow")
722  .arg(displayProperties()->displayName()),
723  _FILEINFO_);
724  e.print();
725 
726  return PolygonTools::MakeMultiPolygon(imgPoly.Polys()->clone());
727  }
728 
729 
735  bool hasCamStats = false;
736 
737  Pvl &label = *cube()->label();
738  for (int i = 0; !hasCamStats && i < label.objects(); i++) {
739  PvlObject &obj = label.object(i);
740 
741  try {
742  if (obj.name() == "Table") {
743  if (obj["Name"][0] == "CameraStatistics") {
744  hasCamStats = true;
745  }
746  }
747  }
748  catch (IException &) {
749  }
750  }
751 
752  if (hasCamStats) {
753  Table camStatsTable("CameraStatistics", m_fileName, label);
754 
755  int numRecords = camStatsTable.Records();
756  for (int recordIndex = 0; recordIndex < numRecords; recordIndex++) {
757  TableRecord &record = camStatsTable[recordIndex];
758 
759  // The TableField class gives us a std::string with NULL (\0) characters... be careful not
760  // to keep them when going to QString.
761  QString recordName((QString)record["Name"]);
762  double avgValue = (double)record["Average"];
763 
764  if (recordName == "AspectRatio") {
765  m_aspectRatio = avgValue;
766  }
767  else if (recordName == "Resolution") {
768  m_resolution = avgValue;
769  }
770  else if (recordName == "EmissionAngle") {
771  m_emissionAngle = Angle(avgValue, Angle::Degrees);
772  }
773  else if (recordName == "IncidenceAngle") {
775  }
776  else if (recordName == "LineResolution") {
777  m_lineResolution = avgValue;
778  }
779  else if (recordName == "LocalRadius") {
781  }
782  else if (recordName == "NorthAzimuth") {
783  m_northAzimuth = Angle(avgValue, Angle::Degrees);
784  }
785  else if (recordName == "PhaseAngle") {
786  m_phaseAngle = Angle(avgValue, Angle::Degrees);
787  }
788  else if (recordName == "SampleResolution") {
789  m_sampleResolution = avgValue;
790  }
791  }
792  }
793 
794  for (int i = 0; i < label.objects(); i++) {
795  PvlObject &obj = label.object(i);
796  try {
797  if (obj.hasGroup("Instrument")) {
798  PvlGroup instGroup = obj.findGroup("Instrument");
799 
800  if (instGroup.hasKeyword("SpacecraftName"))
801  m_spacecraftName = obj.findGroup("Instrument")["SpacecraftName"][0];
802 
803  if (instGroup.hasKeyword("InstrumentId"))
804  m_instrumentId = obj.findGroup("Instrument")["InstrumentId"][0];
805  }
806  }
807  catch (IException &) {
808  }
809  }
810  }
811 
812 
818  ImagePolygon poly = cube()->readFootprint();
820  }
821 
822 
830  m_image = image;
831  m_imageFolder = imageFolder;
832  }
833 
834 
835 
851  bool Image::XmlHandler::startElement(const QString &namespaceURI, const QString &localName,
852  const QString &qName, const QXmlAttributes &atts) {
853  m_characters = "";
854 
855  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
856  if (localName == "image") {
857  QString id = atts.value("id");
858  QString fileName = atts.value("fileName");
859  QString instrumentId = atts.value("instrumentId");
860  QString spacecraftName = atts.value("spacecraftName");
861 
862  QString aspectRatioStr = atts.value("aspectRatio");
863  QString resolutionStr = atts.value("resolution");
864  QString emissionAngleStr = atts.value("emissionAngle");
865  QString incidenceAngleStr = atts.value("incidenceAngle");
866  QString lineResolutionStr = atts.value("lineResolution");
867  QString localRadiusStr = atts.value("localRadius");
868  QString northAzimuthStr = atts.value("northAzimuth");
869  QString phaseAngleStr = atts.value("phaseAngle");
870  QString sampleResolutionStr = atts.value("sampleResolution");
871 
872  if (!id.isEmpty()) {
873  delete m_image->m_id;
874  m_image->m_id = NULL;
875  m_image->m_id = new QUuid(id.toLatin1());
876  }
877 
878  if (!fileName.isEmpty()) {
879  m_image->m_fileName = m_imageFolder.expanded() + "/" + fileName;
880  }
881 
882  if (!instrumentId.isEmpty()) {
883  m_image->m_instrumentId = instrumentId;
884  }
885 
886  if (!spacecraftName.isEmpty()) {
887  m_image->m_spacecraftName = spacecraftName;
888  }
889 
890  if (!aspectRatioStr.isEmpty()) {
891  m_image->m_aspectRatio = aspectRatioStr.toDouble();
892  }
893 
894  if (!resolutionStr.isEmpty()) {
895  m_image->m_resolution = resolutionStr.toDouble();
896  }
897 
898  if (!emissionAngleStr.isEmpty()) {
899  m_image->m_emissionAngle = Angle(emissionAngleStr.toDouble(), Angle::Radians);
900  }
901 
902  if (!incidenceAngleStr.isEmpty()) {
903  m_image->m_incidenceAngle = Angle(incidenceAngleStr.toDouble(), Angle::Radians);
904  }
905 
906  if (!lineResolutionStr.isEmpty()) {
907  m_image->m_lineResolution = lineResolutionStr.toDouble();
908  }
909 
910  if (!localRadiusStr.isEmpty()) {
911  m_image->m_localRadius = Distance(localRadiusStr.toDouble(), Distance::Meters);
912  }
913 
914  if (!northAzimuthStr.isEmpty()) {
915  m_image->m_northAzimuth = Angle(northAzimuthStr.toDouble(), Angle::Radians);
916  }
917 
918  if (!phaseAngleStr.isEmpty()) {
919  m_image->m_phaseAngle = Angle(phaseAngleStr.toDouble(), Angle::Radians);
920  }
921 
922  if (!sampleResolutionStr.isEmpty()) {
923  m_image->m_sampleResolution = sampleResolutionStr.toDouble();
924  }
925  }
926  else if (localName == "displayProperties") {
927  m_image->m_displayProperties = new ImageDisplayProperties(reader());
928  }
929  }
930 
931  return true;
932  }
933 
934 
945  bool Image::XmlHandler::characters(const QString &ch) {
946  m_characters += ch;
947 
948  return XmlStackedHandler::characters(ch);
949  }
950 
951 
963  bool Image::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
964  const QString &qName) {
965  if (localName == "footprint" && !m_characters.isEmpty()) {
966  geos::io::WKTReader wktReader(*globalFactory);
967  m_image->m_footprint = PolygonTools::MakeMultiPolygon(
968  wktReader.read(m_characters.toStdString()));
969  }
970  else if (localName == "image" && !m_image->m_footprint) {
971  QMutex mutex;
972  m_image->initFootprint(&mutex);
973  m_image->closeCube();
974  }
975 
976  m_characters = "";
977  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
978  }
979 }
Isis::Image::m_cube
Cube * m_cube
The cube associated with this Image.
Definition: Image.h:206
Isis::Image::m_localRadius
Distance m_localRadius
Local radius of the image.
Definition: Image.h:253
Isis::Image::m_phaseAngle
Angle m_phaseAngle
Phase angle for the image.
Definition: Image.h:255
Isis::Image::XmlHandler::XmlHandler
XmlHandler(Image *image, FileName imageFolder)
Create an XML Handler (reader) that can populate the Image class data.
Definition: Image.cpp:829
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
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Cube::fileName
virtual QString fileName() const
Returns the opened cube's filename.
Definition: Cube.cpp:1563
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::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::Image::m_resolution
double m_resolution
Resolution of the image.
Definition: Image.h:248
Isis::Image::m_footprint
geos::geom::MultiPolygon * m_footprint
A 0-360 ocentric lon,lat degrees footprint of this Image.
Definition: Image.h:241
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
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
Isis::Image::XmlHandler::m_image
Image * m_image
Pointer to the Image.
Definition: Image.h:185
Isis::Image::m_spacecraftName
QString m_spacecraftName
Spacecraft name associated with this Image.
Definition: Image.h:236
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
Isis::PvlObject::hasGroup
bool hasGroup(const QString &name) const
Returns a boolean value based on whether the object has the specified group or not.
Definition: PvlObject.h:210
ImageDisplayProperties.h
Isis::Image::m_displayProperties
ImageDisplayProperties * m_displayProperties
The GUI information for how this Image ought to be displayed.
Definition: Image.h:211
Isis::Image::initQuickFootprint
void initQuickFootprint()
Creates a default ImagePolygon option which is read into the Cube.
Definition: Image.cpp:817
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
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::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::Image::XmlHandler::m_imageFolder
FileName m_imageFolder
The Name/path of the image.
Definition: Image.h:186
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
Isis::TableRecord
Definition: TableRecord.h:38
Isis::Image::m_id
QUuid * m_id
A unique ID for this Image (useful for others to reference this Image when saving to disk).
Definition: Image.h:245
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
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
Isis::Image::m_observationNumber
QString m_observationNumber
The observation number for this image.
Definition: Image.h:226
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::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
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::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Cube::lineCount
int lineCount() const
Definition: Cube.cpp:1734
Isis::FileName::dir
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
Definition: FileName.cpp:465
Isis::Image::createFootprint
geos::geom::MultiPolygon * createFootprint(QMutex *cameraMutex)
Calculates a footprint for an Image using the camera or projection information.
Definition: Image.cpp:706
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::m_northAzimuth
Angle m_northAzimuth
North Azimuth for the image.
Definition: Image.h:254
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
Isis::Image::footprint
geos::geom::MultiPolygon * footprint()
Get the footprint of this image (if available).
Definition: Image.cpp:374
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
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::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
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::Image::XmlHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
The XML reader invokes this method at the end of every element in the XML document.
Definition: Image.cpp:963
Isis::Image::m_incidenceAngle
Angle m_incidenceAngle
Incidence angle of the image.
Definition: Image.h:250
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::Image::XmlHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Read mage class attributes.
Definition: Image.cpp:851
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::Image::m_serialNumber
QString m_serialNumber
The serial number for this image.
Definition: Image.h:231
Isis::Image::m_emissionAngle
Angle m_emissionAngle
Emmission angle of the image.
Definition: Image.h:249
Isis::Image::m_instrumentId
QString m_instrumentId
Instrument id associated with this Image.
Definition: Image.h:221
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
Isis::Image::m_lineResolution
double m_lineResolution
Line resolution of the image.
Definition: Image.h:251
Isis::Image::XmlHandler::characters
virtual bool characters(const QString &ch)
This implementation of a virtual function calls QXmlDefaultHandler::characters(QString &ch) which in ...
Definition: Image.cpp:945
Isis::Distance::meters
double meters() const
Get the distance in meters.
Definition: Distance.cpp:85
Isis::Image::initCamStats
void initCamStats()
Checks to see if the Cube label contains Camera Statistics.
Definition: Image.cpp:734
Isis::Image::toPvl
PvlObject toPvl() const
Convert this Image to PVL.
Definition: Image.cpp:226
Isis::Image::m_fileName
QString m_fileName
The on-disk file name of the cube associated with this Image.
Definition: Image.h:216
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::Image::XmlHandler
Process XML in a stack-oriented fashion.
Definition: Image.h:172
QObject
Isis::Image::incidenceAngle
Angle incidenceAngle() const
Get the incidence angle of this image, as calculated and attached by camstats.
Definition: Image.cpp:475
Isis::Table::Records
int Records() const
Returns the number of records.
Definition: Table.cpp:313
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
Isis::Image::observationNumber
QString observationNumber()
Returns the observation number of the Cube.
Definition: Image.cpp:349
Isis::Project::imageDataRoot
static QString imageDataRoot(QString projectRoot)
Appends the root directory name 'images' to the project .
Definition: Project.cpp:2067
Isis::Image::~Image
~Image()
Clean up this image.
Definition: Image.cpp:161
Isis::Image::m_sampleResolution
double m_sampleResolution
Sample resolution of the image.
Definition: Image.h:252
Isis::ImagePolygon::Polys
geos::geom::MultiPolygon * Polys()
Return a geos Multipolygon.
Definition: ImagePolygon.h:210
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
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::Image::m_bodyCode
SpiceInt * m_bodyCode
The NaifBodyCode value, if it exists in the labels.
Definition: Image.h:195
Isis::Image::m_aspectRatio
double m_aspectRatio
Aspect ratio of the image.
Definition: Image.h:247
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