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. More... | |
Public Member Functions | |
Image (QString imageFileName, QObject *parent=0) | |
Create an image from a cube file on disk. More... | |
Image (Cube *imageCube, QObject *parent=0) | |
Create an image from a cube file on disk. More... | |
Image (Cube *imageCube, geos::geom::MultiPolygon *footprint, QString id, QObject *parent=0) | |
Create an image from a cube file on disk including the footprint. More... | |
Image (FileName imageFolder, XmlStackedHandlerReader *xmlReader, QObject *parent=0) | |
Construct this image from XML. More... | |
~Image () | |
Clean up this image. More... | |
void | fromPvl (const PvlObject &pvl) |
Read the image settings from a Pvl. More... | |
PvlObject | toPvl () const |
Convert this Image to PVL. More... | |
bool | isFootprintable () const |
Test to see if it's possible to create a footprint from this image. More... | |
Cube * | cube () |
Get the Cube pointer associated with this display property. More... | |
void | closeCube () |
Cleans up the Cube pointer. More... | |
ImageDisplayProperties * | displayProperties () |
Get the display (GUI) properties (information) associated with this image. More... | |
const ImageDisplayProperties * | displayProperties () const |
Get a non-mutable (const) the display (GUI) properties (information) associated with this image. More... | |
QString | fileName () const |
Get the file name of the cube that this image represents. More... | |
QString | observationNumber () |
Returns the observation number of the Cube. More... | |
QString | serialNumber () |
Returns the serial number of the Cube. More... | |
geos::geom::MultiPolygon * | footprint () |
Get the footprint of this image (if available). More... | |
const geos::geom::MultiPolygon * | footprint () const |
Get the non-mutable (const) footprint of this image (if available). More... | |
void | setId (QString id) |
Override the automatically generated ID with the given ID. More... | |
bool | initFootprint (QMutex *cameraMutex) |
Calculate a footprint for this image. More... | |
double | aspectRatio () const |
Get the aspect ratio of this image, as calculated and attached by camstats. More... | |
QString | id () const |
Get a unique, identifying string associated with this image. More... | |
double | resolution () const |
Get the resolution of this image, as calculated and attached by camstats. More... | |
Angle | emissionAngle () const |
Get the emission angle of this image, as calculated and attached by camstats. More... | |
Angle | incidenceAngle () const |
Get the incidence angle of this image, as calculated and attached by camstats. More... | |
double | lineResolution () const |
Get the line resolution of this image, as calculated and attached by camstats. More... | |
Distance | localRadius () const |
Get the local radius of this image, as calculated and attached by camstats. More... | |
Angle | northAzimuth () const |
Get the north azimuth of this image, as calculated and attached by camstats. More... | |
Angle | phaseAngle () const |
Get the phase angle of this image, as calculated and attached by camstats. More... | |
double | sampleResolution () const |
Get the sample resolution of this image, as calculated and attached by camstats. More... | |
void | copyToNewProjectRoot (const Project *project, FileName newProjectRoot) |
Copy the cub/ecub files associated with this image into the new project. More... | |
void | deleteFromDisk () |
Delete the image data from disk. More... | |
void | save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const |
Write the Image properties out to an XML file. More... | |
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::Cube::fileName(), and 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 Isis::Cube::fileName(), 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, and Isis::XmlStackedHandlerReader::pushContentHandler().
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::Cube::copy(), Isis::Cube::externalCubeFileName(), Isis::Project::imageDataRoot(), Isis::FileName::name(), Isis::Project::newProjectRoot(), Isis::FileName::path(), Isis::Project::projectRoot(), Isis::FileName::setExtension(), Isis::Cube::storesDnData(), 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::FileName::expanded(), 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(), Isis::MosaicSceneWidget::cubeFileNames(), Isis::ImageFileListWidget::filterFileList(), 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::PvlObject::findObject(), Isis::DisplayProperties::fromPvl(), Isis::PvlObject::hasKeyword(), and Isis::IException::Unknown.
QString Isis::Image::id | ( | ) | const |
Get a unique, identifying string associated with this image.
Referenced by Isis::Project::addImagesToIdMap(), Isis::CubeDnView::save(), Isis::MosaicSceneWidget::save(), Isis::ImageFileListWidget::toPvl(), and Isis::MosaicSceneWidget::toPvl().
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::PvlObject::hasKeyword(), Isis::PvlContainer::isNamed(), Isis::Cube::label(), Isis::Blob::Name(), Isis::PvlObject::object(), Isis::PvlObject::objects(), 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(), and Isis::JigsawSetupDialog::treeViewSelectionChanged().
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(), Isis::ReadWrite, 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::FileName::expanded(), Isis::Project::imageDataRoot(), and Isis::FileName::name().