Isis Developer Reference
|
This represents a cube in a project-based GUI interface. More...
#include <Image.h>
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 (Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id, QObject *parent=0) | |
Create an image from a cube file on disk including the footprint. | |
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 pointer associated with this display property. | |
void | closeCube () |
Cleans up the Cube pointer. | |
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. | |
QString | observationNumber () |
Returns the observation number of the Cube. | |
QString | serialNumber () |
Returns the serial number of the Cube. | |
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 |
Write the Image properties out to an XML file. | |
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()).
|
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 |
References cube(), 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 |
References Isis::Null.
|
explicit |
Create an image from a cube file on disk including the footprint.
imageFileName | The name of a cube on disk - /work/users/.../blah.cub |
footprint | The calculated footprint |
parent | The Qt-relationship parent |
References footprint(), Isis::Null, and setId().
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 |
References Isis::Null.
Isis::Image::~Image | ( | ) |
Clean up this image.
If you haven't saved this image, all of its settings will be lost.
double Isis::Image::aspectRatio | ( | ) | const |
Get the aspect ratio of this image, as calculated and attached by camstats.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
void Isis::Image::closeCube | ( | ) |
Cleans up the Cube pointer.
You want to call this once you are sure you are done with the Cube because the OS will limit how many of these we have open.
Referenced by deleteFromDisk(), Isis::ImageList::ImageList(), Isis::BundleAdjust::imageLists(), and updateFileName().
Copy the cub/ecub files associated with this image into the new project.
newProjectRoot | The root directory where the project is stored. |
References Isis::Project::imageDataRoot(), Isis::FileName::name(), Isis::Project::newProjectRoot(), Isis::Project::projectRoot(), Isis::FileName::setExtension(), and Isis::FileName::toString().
Cube * Isis::Image::cube | ( | ) |
Get the Cube pointer associated with this display property.
This will allocate the Cube pointer if one is not already present.
IException::Programmer | "Cube cannot be created" |
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Isis::Workspace::addImages(), deleteFromDisk(), Image(), Isis::JigsawSetupDialog::JigsawSetupDialog(), observationNumber(), and serialNumber().
void Isis::Image::deleteFromDisk | ( | ) |
Delete the image data from disk.
The cube() will no longer be accessible until you call updateFileName().
IException::Io | "Could not remove file [$filename]" |
References _FILEINFO_, closeCube(), cube(), Isis::Cube::externalCubeFileName(), Isis::IException::Io, Isis::FileName::path(), and Isis::FileName::setExtension().
Referenced by Isis::ImageList::deleteFromDisk().
ImageDisplayProperties * Isis::Image::displayProperties | ( | ) |
Get the display (GUI) properties (information) associated with this image.
Referenced by Isis::ImageList::allSupport(), Isis::MosaicSceneItem::color(), Isis::MosaicSceneItem::contextMenuEvent(), Isis::MosaicSceneItem::cubeDisplayChanged(), Isis::MosaicSceneWidget::cubeToMosaic(), fromPvl(), Isis::ImageListActionWorkOrder::ImageListActionWorkOrder(), Isis::ImageTreeWidgetItem::ImageTreeWidgetItem(), initFootprint(), Isis::MosaicSceneItem::MosaicSceneItem(), Isis::ProjectItemModel::onSelectionChanged(), Isis::MosaicSceneItem::paint(), Isis::ImageTreeWidget::prepCube(), Isis::MosaicSceneItem::reproject(), Isis::ImageListActionWorkOrder::setData(), Isis::ImageList::supportedActions(), toPvl(), Isis::ImageTreeWidgetItem::update(), and Isis::MosaicSceneItem::updateSelection().
const ImageDisplayProperties * Isis::Image::displayProperties | ( | ) | const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this image.
Angle Isis::Image::emissionAngle | ( | ) | const |
Get the emission angle of this image, as calculated and attached by camstats.
This is the image-wide average.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
QString Isis::Image::fileName | ( | ) | const |
Get the file name of the cube that this image represents.
Referenced by Isis::BundleAdjust::BundleAdjust(), and Isis::ProjectItem::setImage().
geos::geom::MultiPolygon * Isis::Image::footprint | ( | ) |
Get the footprint of this image (if available).
Referenced by Image().
const geos::geom::MultiPolygon * Isis::Image::footprint | ( | ) | const |
Get the non-mutable (const) footprint of this image (if available).
void Isis::Image::fromPvl | ( | const PvlObject & | pvl | ) |
Read the image settings from a Pvl.
The Pvl file looks like this:
Object = Image FileName = ... ID = ... EndObject
pvl | The PvlObject that contains image information. |
IException::Unknown | "Tried to load Image with properties/information" |
References _FILEINFO_, displayProperties(), Isis::DisplayProperties::fromPvl(), and Isis::IException::Unknown.
QString Isis::Image::id | ( | ) | const |
Get a unique, identifying string associated with this image.
Referenced by Isis::Project::addImagesToIdMap(), and Isis::CubeDnView::save().
Angle Isis::Image::incidenceAngle | ( | ) | const |
Get the incidence angle of this image, as calculated and attached by camstats.
This is the image-wide average.
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.
cameraMutex | A pointer to the camera mutex to lock the camera resource while a footprint is created. |
IException::Io | "Could not read the footprint from cube [$cube]. Please make sure footprintinit has been run" |
References _FILEINFO_, Isis::DisplayProperties::displayName(), displayProperties(), and Isis::IException::Io.
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.
References Isis::Cube::label(), Isis::PvlObject::object(), Isis::ImagePolygon::toBlob(), and Isis::Blob::Type().
Referenced by Isis::Footprint2DViewWorkOrder::isExecutable().
double Isis::Image::lineResolution | ( | ) | const |
Get the line resolution of this image, as calculated and attached by camstats.
This is the image-wide average.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
Distance Isis::Image::localRadius | ( | ) | const |
Get the local radius of this image, as calculated and attached by camstats.
This is the image-wide average.
Angle Isis::Image::northAzimuth | ( | ) | const |
Get the north azimuth of this image, as calculated and attached by camstats.
This is the image-wide average.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
QString Isis::Image::observationNumber | ( | ) |
Returns the observation number of the Cube.
References Isis::ObservationNumber::Compose(), and cube().
Referenced by Isis::JigsawSetupDialog::JigsawSetupDialog().
Angle Isis::Image::phaseAngle | ( | ) | const |
Get the phase angle of this image, as calculated and attached by camstats.
This is the image-wide average.
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.
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.
Referenced by Isis::ImageTreeWidgetItem::ImageTreeWidgetItem().
void Isis::Image::save | ( | QXmlStreamWriter & | stream, |
const Project * | project, | ||
FileName | newProjectRoot ) const |
Write the Image properties out to an XML file.
stream | The output data stream. |
project | The project this image is contained within. |
newProjectRoot | The path/filename we are writing to. |
Output format:
<image id="..." fileName="..."> ... </image>
(fileName attribute is just the base name)
References Isis::IsSpecial(), Isis::Angle::isValid(), Isis::Distance::isValid(), Isis::Distance::meters(), Isis::Angle::radians(), Isis::DisplayProperties::save(), and Isis::IString::ToQt().
Referenced by Isis::ImageList::save().
QString Isis::Image::serialNumber | ( | ) |
Returns the serial number of the Cube.
References Isis::SerialNumber::Compose(), and cube().
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
References displayProperties(), and Isis::DisplayProperties::toPvl().
Referenced by Isis::MosaicController::saveProject().
|
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. |
References closeCube(), Isis::FileName::dir(), Isis::Project::imageDataRoot(), and Isis::FileName::name().