Isis 3.0 Object Programmers' Reference |
Home |
This represents a cube in a project-based GUI interface. More...
#include <Image.h>
Classes | |
class | XmlHandler |
Public Slots | |
void | updateFileName (Project *) |
Change the on-disk file name for this cube to be where the image ought to be in the given project. | |
Public Member Functions | |
Image (QString imageFileName, QObject *parent=0) | |
Create an image from a cube file on disk. | |
Image (Cube *imageCube, QObject *parent=0) | |
Create an image from a cube file on disk. | |
Image (FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent=0) | |
Construct this image from XML. | |
~Image () | |
Clean up this image. | |
void | fromPvl (const PvlObject &pvl) |
Read the image settings from a Pvl. | |
PvlObject | toPvl () const |
Convert this Image to PVL. | |
bool | isFootprintable () const |
Test to see if it's possible to create a footprint from this image. | |
Cube * | cube () |
Get the Cube * associated with this display property. | |
void | closeCube () |
Cleans up the Cube *. | |
ImageDisplayProperties * | displayProperties () |
Get the display (GUI) properties (information) associated with this image. | |
const ImageDisplayProperties * | displayProperties () const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this image. | |
QString | fileName () const |
Get the file name of the cube that this image represents. | |
geos::geom::MultiPolygon * | footprint () |
Get the footprint of this image (if available). | |
const geos::geom::MultiPolygon * | footprint () const |
Get the non-mutable (const) footprint of this image (if available). | |
void | setId (QString id) |
Override the automatically generated ID with the given ID. | |
bool | initFootprint (QMutex *cameraMutex) |
Calculate a footprint for this image. | |
double | aspectRatio () const |
Get the aspect ratio of this image, as calculated and attached by camstats. | |
QString | id () const |
Get a unique, identifying string associated with this image. | |
double | resolution () const |
Get the resolution of this image, as calculated and attached by camstats. | |
Angle | emissionAngle () const |
Get the emission angle of this image, as calculated and attached by camstats. | |
Angle | incidenceAngle () const |
Get the incidence angle of this image, as calculated and attached by camstats. | |
double | lineResolution () const |
Get the line resolution of this image, as calculated and attached by camstats. | |
Distance | localRadius () const |
Get the local radius of this image, as calculated and attached by camstats. | |
Angle | northAzimuth () const |
Get the north azimuth of this image, as calculated and attached by camstats. | |
Angle | phaseAngle () const |
Get the phase angle of this image, as calculated and attached by camstats. | |
double | sampleResolution () const |
Get the sample resolution of this image, as calculated and attached by camstats. | |
void | copyToNewProjectRoot (const Project *project, FileName newProjectRoot) |
Copy the cub/ecub files associated with this image into the new project. | |
void | deleteFromDisk () |
Delete the image data from disk. | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Output format: | |
Private Member Functions | |
geos::geom::MultiPolygon * | createFootprint (QMutex *cameraMutex) |
Calculate a footprint for an Image using the camera or projection information. | |
void | initCamStats () |
void | initQuickFootprint () |
Image (const Image &other) | |
Image & | operator= (const Image &rhs) |
Private Attributes | |
Cube * | m_cube |
The cube associated with this Image. | |
ImageDisplayProperties * | m_displayProperties |
The GUI information for how this Image ought to be displayed. | |
QString | m_fileName |
The on-disk file name of the cube associated with this Image. | |
geos::geom::MultiPolygon * | m_footprint |
A 0-360 ocentric lon,lat degrees footprint of this Image. | |
QUuid * | m_id |
A unique ID for this Image (useful for others to reference this Image when saving to disk). | |
double | m_aspectRatio |
double | m_resolution |
Angle | m_emissionAngle |
Angle | m_incidenceAngle |
double | m_lineResolution |
Distance | m_localRadius |
Angle | m_northAzimuth |
Angle | m_phaseAngle |
double | m_sampleResolution |
This represents a cube in a project-based GUI interface.
The actual cube doesn't have to be open. This encapsulates ideas about an image such as it's footprint, it's cube, how it should be viewed, where it is on disk, etc. This class is designed to be semi-light weight - we should be able to have tens of thousands of these in memory without any issues (provided the Cube files aren't open - see closeCube()).
2011-05-11 Steven Lambright - Added accessors for data that is complicated to get or expensive (i.e. Camera statistics and the footprint).
2011-05-18 Steven Lambright - Fixed the second constructor
2012-10-02 Steven Lambright - Added support for camera statistics information that used to be in CubeDisplayProperties (a class that no longer exists).
2012-10-04 Jeannie Backer Changed references to TableField methods to lower camel case. Fixed history entry indentation. Added padding to control statements. References #1169.
|
explicit |
Create an image from a cube file on disk.
imageFileName | The name of a cube on disk - /work/users/.../blah.cub |
parent | The Qt-relationship parent |
Definition at line 37 of file Image.cpp.
References cube(), m_cube, m_displayProperties, m_fileName, m_footprint, m_id, and Isis::Null.
Create an image from a cube file on disk.
imageFileName | The name of a cube on disk - /work/users/.../blah.cub |
parent | The Qt-relationship parent |
Definition at line 72 of file Image.cpp.
References Isis::Cube::fileName(), m_cube, m_displayProperties, m_fileName, m_footprint, m_id, and Isis::Null.
Isis::Image::Image | ( | FileName | imageFolder, |
XmlStackedHandlerReader * | xmlReader, | ||
QObject * | parent = 0 |
||
) |
Construct this image from XML.
imageFolder | Where this image XML resides - /work/.../projectRoot/images/import1 |
xmlReader | An XML reader that's up to an <image> tag. |
parent | The Qt-relationship parent |
Definition at line 106 of file Image.cpp.
References m_cube, m_displayProperties, m_footprint, m_id, and Isis::Null.
Isis::Image::~Image | ( | ) |
Clean up this image.
If you haven't saved this image, all of its settings will be lost.
Definition at line 125 of file Image.cpp.
References m_cube, m_displayProperties, m_footprint, and m_id.
double Isis::Image::aspectRatio | ( | ) | const |
Get the aspect ratio of this image, as calculated and attached by camstats.
Definition at line 355 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
void Isis::Image::closeCube | ( | ) |
Cleans up the Cube *.
You want to call this once you're sure you are done with the Cube because the OS will limit how many of these we have open.
Definition at line 256 of file Image.cpp.
References m_cube.
Referenced by deleteFromDisk(), Isis::ImportImagesWorkOrder::importConfirmedImages(), Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()(), and updateFileName().
Copy the cub/ecub files associated with this image into the new project.
Definition at line 461 of file Image.cpp.
References Isis::Cube::externalCubeFileName(), Isis::Project::imageDataRoot(), m_fileName, Isis::FileName::path(), and Isis::Project::projectRoot().
|
private |
Calculate a footprint for an Image using the camera or projection information.
cameraMutex | A mutex that guarantees us serial access to the camera/projection classes |
Definition at line 612 of file Image.cpp.
References _FILEINFO_, Isis::ImagePolygon::Create(), cube(), displayProperties(), Isis::Cube::lineCount(), Isis::PolygonTools::MakeMultiPolygon(), Isis::ImagePolygon::Polys(), Isis::IException::print(), Isis::Cube::sampleCount(), and Isis::IException::User.
Referenced by initFootprint().
Cube * Isis::Image::cube | ( | ) |
Get the Cube * associated with this display property.
This will allocate the Cube * if one is not already present.
Definition at line 243 of file Image.cpp.
References m_cube, and m_fileName.
Referenced by createFootprint(), deleteFromDisk(), Isis::MosaicSceneItem::drawImage(), Isis::MosaicSceneItem::getPixelValue(), Isis::MosaicSceneItem::getStretch(), Image(), and Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()().
void Isis::Image::deleteFromDisk | ( | ) |
Delete the image data from disk.
The cube() will no longer be accessible until you call updateFileName().
Definition at line 497 of file Image.cpp.
References _FILEINFO_, closeCube(), cube(), Isis::Cube::externalCubeFileName(), Isis::IException::Io, m_fileName, and Isis::FileName::path().
Referenced by Isis::ImageList::deleteFromDisk().
ImageDisplayProperties * Isis::Image::displayProperties | ( | ) |
Get the display (GUI) properties (information) associated with this image.
Definition at line 269 of file Image.cpp.
References m_displayProperties.
Referenced by Isis::ImageList::allSupport(), Isis::MosaicSceneItem::contextMenuEvent(), createFootprint(), Isis::MosaicSceneItem::cubeDisplayChanged(), Isis::MosaicControlNetTool::displayConnectivity(), fromPvl(), Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), Isis::ImportImagesWorkOrder::importConfirmedImages(), initFootprint(), Isis::MosaicSceneItem::MosaicSceneItem(), Isis::MosaicSceneItem::paint(), Isis::MosaicSceneItem::reproject(), Isis::MosaicSceneWidget::reprojectItems(), Isis::ImageList::saveAndToggleShowDNs(), Isis::ImageList::saveAndToggleShowFill(), Isis::ImageList::saveAndToggleShowLabel(), Isis::ImageList::saveAndToggleShowOutline(), Isis::ImageListActionWorkOrder::setData(), Isis::ImageList::showRandomColor(), Isis::ImageList::supportedActions(), Isis::Footprint2DViewWorkOrder::syncRedo(), toPvl(), Isis::MosaicSceneItem::updateChildren(), and Isis::MosaicSceneItem::updateSelection().
const ImageDisplayProperties * Isis::Image::displayProperties | ( | ) | const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this image.
Definition at line 280 of file Image.cpp.
References m_displayProperties.
Angle Isis::Image::emissionAngle | ( | ) | const |
Get the emission angle of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 387 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
QString Isis::Image::fileName | ( | ) | const |
Get the file name of the cube that this image represents.
Definition at line 290 of file Image.cpp.
References m_fileName.
Referenced by Isis::ExportImagesWorkOrder::ProjectImageExportFunctor::operator()(), and Isis::Image::XmlHandler::startElement().
geos::geom::MultiPolygon * Isis::Image::footprint | ( | ) |
Get the footprint of this image (if available).
Definition at line 300 of file Image.cpp.
References m_footprint.
const geos::geom::MultiPolygon * Isis::Image::footprint | ( | ) | const |
Get the non-mutable (const) footprint of this image (if available).
Definition at line 318 of file Image.cpp.
References m_footprint.
void Isis::Image::fromPvl | ( | const PvlObject & | pvl | ) |
Read the image settings from a Pvl.
Object = Image FileName = ... ID = ... EndObject
pvl | The PvlObject that contains image information. |
Definition at line 154 of file Image.cpp.
References _FILEINFO_, displayProperties(), Isis::PvlObject::findObject(), Isis::PvlObject::hasKeyword(), m_fileName, m_id, and Isis::IException::Unknown.
Referenced by Isis::ImageReader::VariantToImageFunctor::operator()().
QString Isis::Image::id | ( | ) | const |
Get a unique, identifying string associated with this image.
Definition at line 365 of file Image.cpp.
References m_id.
Referenced by Isis::ImportImagesWorkOrder::importConfirmedImages().
Angle Isis::Image::incidenceAngle | ( | ) | const |
Get the incidence angle of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 398 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
bool Isis::Image::initFootprint | ( | QMutex * | cameraMutex | ) |
Calculate a footprint for this image.
If the footprint is already stored inside the cube, that will be used instead. If no footprint can be found, this throws an exception.
Definition at line 327 of file Image.cpp.
References _FILEINFO_, createFootprint(), Isis::DisplayProperties::displayName(), displayProperties(), Isis::IException::Io, and m_footprint.
Referenced by Isis::ImageReader::VariantToImageFunctor::operator()().
bool Isis::Image::isFootprintable | ( | ) | const |
Test to see if it's possible to create a footprint from this image.
This may not give an accurate answer if the cube isn't open.
Definition at line 212 of file Image.cpp.
References Isis::PvlObject::hasKeyword(), Isis::PvlContainer::isNamed(), Isis::Cube::label(), m_cube, m_footprint, Isis::Blob::Name(), Isis::PvlObject::object(), Isis::PvlObject::objects(), and Isis::Blob::Type().
Referenced by Isis::Footprint2DViewWorkOrder::isExecutable(), and Isis::Footprint2DViewWorkOrder::syncRedo().
double Isis::Image::lineResolution | ( | ) | const |
Get the line resolution of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 409 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
Distance Isis::Image::localRadius | ( | ) | const |
Angle Isis::Image::northAzimuth | ( | ) | const |
Get the north azimuth of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 431 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
Angle Isis::Image::phaseAngle | ( | ) | const |
Get the phase angle of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 442 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
double Isis::Image::resolution | ( | ) | const |
Get the resolution of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 376 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
double Isis::Image::sampleResolution | ( | ) | const |
Get the sample resolution of this image, as calculated and attached by camstats.
This is the image-wide average.
Definition at line 453 of file Image.cpp.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
void Isis::Image::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot | ||
) | const |
Output format:
<image id="..." filename="..."> ... </image>
(fileName attribute is just the base name)
Definition at line 532 of file Image.cpp.
References Isis::IsSpecial(), Isis::Angle::isValid(), Isis::Distance::isValid(), m_displayProperties, m_fileName, m_footprint, m_id, Isis::Distance::meters(), Isis::Angle::radians(), and Isis::DisplayProperties::save().
Referenced by Isis::ImageList::save().
void Isis::Image::setId | ( | QString | id | ) |
PvlObject Isis::Image::toPvl | ( | ) | const |
Convert this Image to PVL.
The output looks like this:
Object = Image FileName = ... ID = ... EndObject
Definition at line 186 of file Image.cpp.
References displayProperties(), m_fileName, m_id, and Isis::DisplayProperties::toPvl().
|
slot |
Change the on-disk file name for this cube to be where the image ought to be in the given project.
project | The project that this image is stored in |
Definition at line 596 of file Image.cpp.
References closeCube(), Isis::Project::imageDataRoot(), and m_fileName.
|
private |
The cube associated with this Image.
This is usually NULL once the image is done initializing because no more than a thousand of these should ever be open at once.
Definition at line 153 of file Image.h.
Referenced by closeCube(), cube(), Image(), isFootprintable(), and ~Image().
|
private |
|
private |
The on-disk file name of the cube associated with this Image.
Definition at line 161 of file Image.h.
Referenced by copyToNewProjectRoot(), cube(), deleteFromDisk(), fileName(), fromPvl(), Image(), save(), toPvl(), and updateFileName().
|
private |
A 0-360 ocentric lon,lat degrees footprint of this Image.
Definition at line 165 of file Image.h.
Referenced by footprint(), Image(), initFootprint(), isFootprintable(), save(), and ~Image().
|
private |