Isis 3 Programmer Reference

BLOB extraction class. More...

#include <HiBlob.h>

Inheritance diagram for Isis::HiBlob:
Inheritance graph
Collaboration diagram for Isis::HiBlob:
Collaboration graph

Public Member Functions

 HiBlob ()
 Default, mostly useless constructor. More...
 
 HiBlob (Cube &cube, const QString &tblname, const QString &field, const QString &name="HiBlob")
 Constructor providing interface to an ISIS Cube object. More...
 
virtual ~HiBlob ()
 Destructor. More...
 
const HiMatrixbuffer () const
 Return a reference to the data. More...
 
Blobber deepcopy () const
 Create a unique copy of this blob. More...
 
void setName (const QString &name)
 Specifies the name of this class instantiation. More...
 
void setBlobName (const QString &bname)
 Sets the name of the ISIS BLOB object that contains the data. More...
 
void setFieldName (const QString &fname)
 Sets field name in the ISIS BLOB object that contains data. More...
 
int size () const
 Returns the total number of elements (rows * columns) in blob. More...
 
int Lines () const
 Number of rows or lines in the BLOB. More...
 
int Samples () const
 Number of columns or samples in the BLOB. More...
 
QString getName () const
 Returns the name of the BLOB given to refer to this instantiation. More...
 
QString getBlobName () const
 Retrieves the name of the Table object. More...
 
QString getFieldName () const
 Retreive the name of the field in the Tabel object BLOB. More...
 
double * operator[] (int i)
 Returns the ith row/line in the BLOB that can be further referenced into samples. More...
 
double const * operator[] (int i) const
 Returns the ith row/line in the BLOB that can be further referenced into samples. More...
 
void load (const QString &filename)
 Loads the contents of a BLOB from a cube file. More...
 
void load (Cube &cube)
 Loads the contents of a BLOB from a Cube object. More...
 

Protected Types

typedef TNT::Array2D< double > BlobBuf
 Internal buffer uses TNT. More...
 

Protected Member Functions

const BlobBufref () const
 Returns a const reference to the internal buffer for ease of use to derived objects. More...
 

Private Member Functions

void loadDouble (Table &tbl)
 Provides direct reading in of the field data from the BLOB. More...
 
void loadInteger (Table &tbl)
 Provides direct reading in of the field data from the BLOB. More...
 
double int2ToDouble (unsigned int value) const
 
double int2ToDouble (int value) const
 Converts integer data to double precision. More...
 

Private Attributes

QString _blobname
 Name of BLOB to read. More...
 
QString _fieldname
 Name of field in BLOB to read. More...
 
QString _name
 Name of this data set. More...
 
BlobBuf _buf
 Buffer holding data. More...
 

Detailed Description

BLOB extraction class.

This class provides access and processing of HiRISE data as stored in an ISIS BLOB (Table).

Note that the file provided must be a HiRISE ISIS cube file that is freshly converted from a PDS compatable EDR (hi2isis). It must contain an ISIS Table named "HiRISE Calibration Image". From that table, data is extracted from the "Calibration" field.

Author
2007-10-09 Kris Becker
See also
Blobber
History:
2008-05-12 Steven Lambright - Removed references to CubeInfo

Definition at line 38 of file HiBlob.h.

Member Typedef Documentation

◆ BlobBuf

typedef TNT::Array2D<double> Isis::Blobber::BlobBuf
protectedinherited

Internal buffer uses TNT.

Definition at line 231 of file Blobber.h.

Constructor & Destructor Documentation

◆ HiBlob() [1/2]

Isis::HiBlob::HiBlob ( )
inline

Default, mostly useless constructor.

Definition at line 43 of file HiBlob.h.

◆ HiBlob() [2/2]

Isis::HiBlob::HiBlob ( Cube cube,
const QString &  tblname,
const QString &  field,
const QString &  name = "HiBlob" 
)
inline

Constructor providing interface to an ISIS Cube object.

Definition at line 48 of file HiBlob.h.

◆ ~HiBlob()

virtual Isis::HiBlob::~HiBlob ( )
inlinevirtual

Destructor.

Definition at line 54 of file HiBlob.h.

Member Function Documentation

◆ buffer()

const HiMatrix& Isis::HiBlob::buffer ( ) const
inline

Return a reference to the data.

Definition at line 57 of file HiBlob.h.

References Isis::Blobber::ref().

◆ deepcopy()

Blobber Isis::Blobber::deepcopy ( ) const
inherited

Create a unique copy of this blob.

This method creates a fully new copy of this object. The default copy constructors/methods create a reference to the data read from the Table object. For example, the following code fragment will result in two Blobbers that refer to the same memory location that stores the BLOB data:

Blobber myblob = yourblob;

To ensure you have two unique storage areas of the BLOB data so they can change independantly, use:

Blobber myblob = yourblob.deepcopy();
Returns
(Blobber) Returns a completely new copy, including data, to caller.

Definition at line 107 of file Blobber.cpp.

References Isis::Blobber::_buf.

◆ getBlobName()

QString Isis::Blobber::getBlobName ( ) const
inlineinherited

Retrieves the name of the Table object.

Returns
(string) Name of the Table

Definition at line 183 of file Blobber.h.

References Isis::Blobber::_blobname.

Referenced by Isis::Blobber::load().

◆ getFieldName()

QString Isis::Blobber::getFieldName ( ) const
inlineinherited

Retreive the name of the field in the Tabel object BLOB.

Returns
(string) Name of the BLOB field

Definition at line 191 of file Blobber.h.

References Isis::Blobber::_fieldname.

Referenced by Isis::Blobber::load(), Isis::Blobber::loadDouble(), and Isis::Blobber::loadInteger().

◆ getName()

QString Isis::Blobber::getName ( ) const
inlineinherited

Returns the name of the BLOB given to refer to this instantiation.

Returns
Name of BLOB instance

Definition at line 175 of file Blobber.h.

References Isis::Blobber::_name.

◆ int2ToDouble()

double Isis::Blobber::int2ToDouble ( int  value) const
privateinherited

Converts integer data to double precision.

This method lives to properly handle the conversion of integer BLOB data to double precision. We must properly convert integer special pixel data that may exist in the BLOB to its appropriate double precision value.

Parameters
[in]value(int) Integer value to convert
Returns
(double) The calculated double precision value

Definition at line 217 of file Blobber.cpp.

◆ Lines()

int Isis::Blobber::Lines ( ) const
inlineinherited

Number of rows or lines in the BLOB.

Returns
The lines or rows

Definition at line 160 of file Blobber.h.

References Isis::Blobber::_buf.

Referenced by Isis::Blobber::size().

◆ load() [1/2]

void Isis::Blobber::load ( const QString &  filename)
inherited

Loads the contents of a BLOB from a cube file.

Provides the I/O interface for ISIS cube files.

Parameters
[in]filename(string&) Name of ISIS cube file to read

Definition at line 120 of file Blobber.cpp.

References Isis::Cube::open().

Referenced by Isis::Blobber::Blobber().

◆ load() [2/2]

void Isis::Blobber::load ( Cube cube)
inherited

Loads the contents of a BLOB from a Cube object.

Provides the I/O interface for the Cube object. One thing to note here is that it creates a CubeInfo object from the Cube object and then calls the CubeInfo load method. Hence, this method is required as an intermediary method that cascades to the actual method that does the real work.

Parameters
[in]cube(Cube&) Reference to an ISIS cube file that has been opened or created in the Cube object.

Definition at line 140 of file Blobber.cpp.

References Isis::Blobber::getBlobName(), Isis::Blobber::getFieldName(), Isis::TableField::isDouble(), Isis::TableField::isInteger(), Isis::Blobber::loadDouble(), Isis::Blobber::loadInteger(), Isis::IException::Programmer, and Isis::Cube::readTable().

◆ loadDouble()

void Isis::Blobber::loadDouble ( Table tbl)
privateinherited

Provides direct reading in of the field data from the BLOB.

This method is called when the data stored in the BLOB is double precision. It determines the number of rows (lines) and columns (samples) in the BLOB and allocates the internal buffer required to store it

Parameters
[in]tbl(Table&) Reference to an ISIS Table object that contains the field from which to extract the data.

Definition at line 167 of file Blobber.cpp.

References Isis::Blobber::_buf, Isis::Blobber::getFieldName(), and Isis::Table::Records().

Referenced by Isis::Blobber::load().

◆ loadInteger()

void Isis::Blobber::loadInteger ( Table tbl)
privateinherited

Provides direct reading in of the field data from the BLOB.

This method is called when the data stored in the BLOB is integer data. It determines the number of rows (lines) and columns (samples) in the BLOB and allocates the internal buffer required to store it. This differs from the double precision version only in the care taken when casting the data to double precision. We must properly convert special pixels from integer to double precision.

Parameters
[in]tbl(Table&) Reference to an ISIS Table object that contains the field from which to extract the data.

Definition at line 193 of file Blobber.cpp.

References Isis::Blobber::_buf, Isis::Blobber::getFieldName(), and Isis::Table::Records().

Referenced by Isis::Blobber::load().

◆ operator[]() [1/2]

double* Isis::Blobber::operator[] ( int  i)
inlineinherited

Returns the ith row/line in the BLOB that can be further referenced into samples.

To access the 2nd sample in the 10th line use:

double sample = blobber[9][1];
Parameters
iIndex
Returns
Pointer to the ith row in the BLOB

Definition at line 206 of file Blobber.h.

References Isis::Blobber::_buf.

◆ operator[]() [2/2]

double const* Isis::Blobber::operator[] ( int  i) const
inlineinherited

Returns the ith row/line in the BLOB that can be further referenced into samples.

This method provides const access to the data in row matrix form. To access the 2nd sample in the 10th line use:

double sample = blobber[9][1];
Parameters
iIndex
Returns
Const pointer to the ith row in the BLOB

Definition at line 221 of file Blobber.h.

References Isis::Blobber::_buf.

◆ ref()

const BlobBuf& Isis::Blobber::ref ( ) const
inlineprotectedinherited

Returns a const reference to the internal buffer for ease of use to derived objects.

Returns
Const reference to BLOB buffer

Definition at line 238 of file Blobber.h.

References Isis::Blobber::_buf.

Referenced by buffer().

◆ Samples()

int Isis::Blobber::Samples ( ) const
inlineinherited

Number of columns or samples in the BLOB.

Returns
The number of samples or columns

Definition at line 167 of file Blobber.h.

References Isis::Blobber::_buf.

Referenced by Isis::Blobber::size().

◆ setBlobName()

void Isis::Blobber::setBlobName ( const QString &  bname)
inlineinherited

Sets the name of the ISIS BLOB object that contains the data.

This is name of a ISIS Table object that contains one or more fields that make up the BLOB. This is the value of the [i]Name[/i] keyword in the Table object.

Parameters
bnameBlobber name

Definition at line 132 of file Blobber.h.

References Isis::Blobber::_blobname.

◆ setFieldName()

void Isis::Blobber::setFieldName ( const QString &  fname)
inlineinherited

Sets field name in the ISIS BLOB object that contains data.

This method sets the name of the field contained within the Table object BLOB from which the data is extracted.

Parameters
fnameField name

Definition at line 144 of file Blobber.h.

References Isis::Blobber::_fieldname.

◆ setName()

void Isis::Blobber::setName ( const QString &  name)
inlineinherited

Specifies the name of this class instantiation.

This is just an additional name that can be used to identify instantiations of this class. It provides a way to uniquely identify each object.

Parameters
nameUnique name

Definition at line 119 of file Blobber.h.

References Isis::Blobber::_name.

◆ size()

int Isis::Blobber::size ( ) const
inlineinherited

Returns the total number of elements (rows * columns) in blob.

Returns
The product of rows and columns

Definition at line 152 of file Blobber.h.

References Isis::Blobber::Lines(), and Isis::Blobber::Samples().

Member Data Documentation

◆ _blobname

QString Isis::Blobber::_blobname
privateinherited

Name of BLOB to read.

Definition at line 243 of file Blobber.h.

Referenced by Isis::Blobber::getBlobName(), and Isis::Blobber::setBlobName().

◆ _buf

◆ _fieldname

QString Isis::Blobber::_fieldname
privateinherited

Name of field in BLOB to read.

Definition at line 244 of file Blobber.h.

Referenced by Isis::Blobber::getFieldName(), and Isis::Blobber::setFieldName().

◆ _name

QString Isis::Blobber::_name
privateinherited

Name of this data set.

Definition at line 245 of file Blobber.h.

Referenced by Isis::Blobber::getName(), and Isis::Blobber::setName().


The documentation for this class was generated from the following file:
Isis::Blobber::Blobber
Blobber()
Default basic constructor that is mostly not useful.
Definition: Blobber.cpp:27