arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

NrroImage Class Reference

#include <nrroImage.h>

Inheritance diagram for NrroImage:

Nrro gutz::Counted TFImage List of all members.

Detailed Description

all nrro images are 3D, I decree: N channels, x, y from fastest to slowest raster order.

see nrro.h for more functinality

Definition at line 34 of file nrroImage.h.

Kinds of Nrros

for more symantic meaning, without subclassing, this might not be a good idea? This class tries to be smart about guessing what kind of nrrd it is, see <nrroKind.cpp> for rules These can be "or'ed" together for instance:
 IMAGE | TIME_SERIES | PROXY 
is a movie (time series image) with no data, just info on it's size and dimensions etc....

enum  NRRO_KINDS {
  KIND_NOT_SET = 0, KIND_UNKNOWN = 1<<0, IMAGE = 1<<1, VOLUME = 1<<2,
  TIME_SERIES = 1<<3, PROXY = 1<<4, KIND_LAST = 1<<5 | 1<<0
}
int getKind () const
int guessKind () const
 guess what kind of data we have

void setKind (int kind)
 set the kind of data, to make it a proxy try: setKind(getKind() | Nrro::PROXY); to make it "not" a PROXY try setKind(getKind() & (~Nrro::PROXY))

void printKind () const
 print kind to std::err


Nrro Types

enum  NRRO_TYPES {
  UNKNOWN = nrrdTypeUnknown, CHAR = nrrdTypeChar, UCHAR = nrrdTypeUChar, SHORT = nrrdTypeShort,
  USHORT = nrrdTypeUShort, INT = nrrdTypeInt, UINT = nrrdTypeUInt, FLOAT = nrrdTypeFloat,
  DOUBLE = nrrdTypeDouble, BLOCK = nrrdTypeBlock, TYPE_LAST = nrrdTypeLast
}
 Let's go ahead and redefine all of the nrrd types ... More...

int getType () const
 Type of nrrd contained here.

void printType () const

Ginsu : Slice and Dice

see nrroGinsu.cpp

enum  NRRO_BOUNDARY_BEHAVIORS { PAD = nrrdBoundaryPad, BLEED = nrrdBoundaryBleed, WRAP = nrrdBoundaryWrap }
 pad, pad out the volume. More...

gutz::SmartPtr< Nrroquantize (int bits, double min=AIR_NAN, double max=AIR_NAN)
 Quantize, set min/max if you want to, otherwise we'll figure out what they are.

gutz::SmartPtr< Nrroslice (int axis, int pos)
 slice, get a slice on axis at pos

gutz::SmartPtr< Nrrocrop (int min[], int max[])
 crop, set axis pos to -1 if you want it left unchanged

gutz::SmartPtr< Nrropad (int min[], int max[], int bound=PAD, double padval=0.0)
 be sure that min and max are valid values, "-1" for min would pad back 1 voxel!!!!

gutz::SmartPtr< NrrocropPad (int min[], int max[], int bound=PAD, double padval=0.0)
 pad and or crop to exact size

gutz::SmartPtr< Nrroresample (int dims[], const NrroKernel &kern=CatmulRomKernel, int bound=BLEED, int typeOut=UNKNOWN)
 resample.

gutz::SmartPtr< Nrroresample (float pct=1.0f)
int insertAxis (unsigned int axis)
 insert axis


Modified - should be Depricated

bool isModified () const
 has it been changed?

void setModified (bool mod=true)

Read & Save

virtual int readNrrd (const char *nrrdFileName, bool proxy=false)
 read returns 0 if read, 1 if error proxy nrro's don't have data, just dimension and type info

virtual int saveNrrd (const char *nrrdFileName)
 save returns 0 if read, 1 if error


get/set the nrrd for direct nrrd hacking!

Yummy, be very carefull here

Nrrd * getNrrd () const
void setNrrd (Nrrd *n)

get the data for even more direct hacking um..

void * getData () const

Dimensions & axis info

int dim () const
 how many axies does this object contain?

int dim (int a) const
 how many values along an axis?

int dimNPad (int a) const
 how many values are not from pading?

float axisSize (int a) const
 what is the physical length of the axis?

float axisSizeNPad (int a) const
 what is the physical length, ignoring paded values?

float axisSpacing (int a) const
 what is the physical spacing between values along an axis

void setAxisSpacing (int a, float s)
char * axisName (int a) const
 what is the name of the axis

char * axisUnit (int a) const
 what are the units of the axis

gutz::vec2ui axisValNPad (int a) const
 ranges of unpadded values along an axis

int size () const
 total size of data

int getStride (int a) const
 strides for accessing fast!

gutz::vec2d getMinMax () const
 min/max values in nrro, r::x = min, r::y = max <nrroGinsu.cpp>


Position & size

only meaningfull if nrro has a spatial position & size

gutz::vec3f getPos () const
void setPos (gutz::vec3f pos)
gutz::vec3f getSizeV3 () const
 ignores padded part, doesn't work for time series 4D vols


Name

like a comment, but, well, a name

std::string getName () const
void setName (std::string name)

comments

see nrroComment.cpp
can also be manipulated using "keys" which use simple text strings as identifiers, This is how we extend the nrrd format, we save things like the position, and pads in comments.

You must make sure key/comment pairs have valid strings for both key and comment, if not, you could get duplicate empty key/comment pairs

int numComments () const
std::string getComment (int i)
std::string getComment (const std::string key)
void addComment (const std::string comment)
void addComment (const std::string key, const std::string comment)
void setComment (int i, const std::string comment)
void setComment (const std::string key, const std::string comment)

Accessors.

()/v() access, use either v(), or operator(), they are the same thing.

example:

       Nrro n;  n(1,3,5) = n(3,1,5); /// set index[5][1][3] to value at index...
or use the alias for clean looking SmartPointer code:
       NrroSP n; n->v(1,3,5) = n->v(3,1,5); /// same as above
you have accessors from 1 to 6 dimensions. remeber () access is fliped from c arrays (x,y,z) vs. [z][y][x]

double v (int i1) const
__dbl v (int i1)
double v (int i1, int i2) const
__dbl v (int i1, int i2)
double v (int i1, int i2, int i3, int i4=0) const
__dbl v (int i1, int i2, int i3, int i4=0)
double v (int i1, int i2, int i3, int i4, int i5, int i6=0) const
__dbl v (int i1, int i2, int i3, int i4, int i5, int i6=0)
double operator() (int i1) const
__dbl operator() (int i1)
double operator() (int i1, int i2) const
__dbl operator() (int i1, int i2)
double operator() (int i1, int i2, int i3, int i4=0) const
__dbl operator() (int i1, int i2, int i3, int i4=0)
double operator() (int i1, int i2, int i3, int i4, int i5, int i6=0) const
__dbl operator() (int i1, int i2, int i3, int i4, int i5, int i6=0)
template<class T> T val (int pos) const
 Accessors.

int a (int i1, int i2=0) const
 fast addressing

int a (int i1, int i2, int i3, int i4=0) const
int a (int i1, int i2, int i3, int i4, int i5, int i6=0) const

Get Iterators

sorry but you have to explicitly ask for the right type: NrroIter<char> niter = nrro->begin<char>() see nrroDispatch.h for some short cuts to grabbing the right type

template<class T> NrroIter< T > begin ()
template<class T> NrroIter< T > last ()
template<class T> const NrroIter< T > end () const

Public Types

enum  FORMATS { GRAY = 1, RGB = 3, RGBA = 4 }
 add more as you need More...


Public Member Functions

 NrroImage (int type, int format, int sx, int sy)
 format is just the number of channels you want, the enum above attaches some symantic meaning to that number, but that's it.

 NrroImage (const char *nrrdFileName)
int nChan () const
int width () const
int height () const
virtual ~NrroImage ()
 papa bear, Nrro, takes care of this

int getFormat () const
 basically the number of channels

void fBlendOverRGBA (NrroImageSP ni)
 this one over ni

void fBlendUnderRGBA (NrroImageSP ni)
 this one under ni

bool isValid () const
 does this nrro contain any usefull information?

virtual void update ()
 bring it up to date.

int forceMultiChannel ()
 This makes all kinds of nrros multi-channel.

void printInfo () const
 Print out what the nrro is, stderr right now.

virtual void setStrides ()
 set the strides, for fast access, usually you won't have to worry about this, when things change internally, this is called automatically, if you muck with the dimensions yourself be sure to update the strides


Protected Member Functions

virtual void initMembers ()
 initiallize member variables

virtual void erase ()
 erase the nrrd and other stuff

virtual void copy (const Nrro &n)
 copy a nrro object

void NrroErr (const char *s, const char *s2=0) const
 send a real error message

void NrroDbg (const char *s, const char *s2=0) const
 message for debugging purposes

virtual void readExtended ()
 Extended features: <nrroExtended.cpp> this next one updates the extended nrrd format by adding things like pos and pads to the comments these can be read in with the nrro after it has been saved.

virtual void writeExtended ()
virtual void writeKind ()
virtual void readKind ()
virtual void writePads ()
virtual void readPads ()
virtual void writePos ()
virtual void readPos ()
virtual void writeName ()
virtual void readName ()
void updateMinMax ()
 cache some slow to compute, but likely static values

virtual void _incCount ()
 gutz::Counted interface, increment reference count by one.

virtual void _decCount ()
 gutz::Counted interface, decrement reference count by one.

virtual int _getCount () const
 gutz::Counted interface, get the current reference count.


Protected Attributes

Nrrd * _nrrd
 the nrrd struct, from teem

int _kind
 Symantics - Kind of Nrro.

gutz::arrayo1v2ui _pads
 if padded, where is the "real" data

gutz::vec3f _pos
 what is the spatial position of this data, may not always be relevant

std::string _name
 does he have a name

int _strides [MAX_NRRO_ARRAY_DIM]
 strides for easy/fast access

bool _valid
 does this guy actuall contain something usefull?

bool _modified
std::string _fileName
 original file name

gutz::vec2d _minmax
unsigned int _size

Friends

class SmartPtr
class SmartPtrRef


Member Enumeration Documentation

enum NrroImage::FORMATS
 

add more as you need

Enumeration values:
GRAY 
RGB 
RGBA 

Definition at line 37 of file nrroImage.h.

enum Nrro::NRRO_BOUNDARY_BEHAVIORS [inherited]
 

pad, pad out the volume.

Enumeration values:
PAD 
BLEED 
WRAP 

Definition at line 245 of file nrro.h.

enum Nrro::NRRO_KINDS [inherited]
 

Enumeration values:
KIND_NOT_SET  We dont know, and haven't even guessed yet.
KIND_UNKNOWN  just a Nrro, no symantics, default if no guess
IMAGE  a 2D image, may have multiple channels
VOLUME  a 3D volume (mutually exclusive with IMAGE)
TIME_SERIES  a time series of ...
PROXY  no data read, just info on the volume
KIND_LAST 

Definition at line 98 of file nrro.h.

enum Nrro::NRRO_TYPES [inherited]
 

Let's go ahead and redefine all of the nrrd types ...

so we don't have to dig through all of gk's .h use Nrro::CHAR, for example

Enumeration values:
UNKNOWN 
CHAR 
UCHAR 
SHORT 
USHORT 
INT 
UINT 
FLOAT 
DOUBLE 
BLOCK 
TYPE_LAST 

Definition at line 129 of file nrro.h.


Constructor & Destructor Documentation

NrroImage::NrroImage int  type,
int  format,
int  sx,
int  sy
 

format is just the number of channels you want, the enum above attaches some symantic meaning to that number, but that's it.

Definition at line 25 of file nrroImage.cpp.

References format, Nrro::IMAGE, Nrro::setKind(), and type.

NrroImage::NrroImage const char *  nrrdFileName  ) 
 

Definition at line 31 of file nrroImage.cpp.

References Nrro::dim(), Nrro::forceMultiChannel(), and Nrro::NrroErr().

virtual NrroImage::~NrroImage  )  [inline, virtual]
 

papa bear, Nrro, takes care of this

Definition at line 55 of file nrroImage.h.


Member Function Documentation

virtual void gutz::Counted::_decCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, decrement reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 54 of file smartptr.h.

Referenced by TFImage::clear(), fBlendOverRGBA(), and Nrro::updateMinMax().

virtual int gutz::Counted::_getCount  )  const [inline, protected, virtual, inherited]
 

gutz::Counted interface, get the current reference count.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr.

Definition at line 58 of file smartptr.h.

virtual void gutz::Counted::_incCount  )  [inline, protected, virtual, inherited]
 

gutz::Counted interface, increment reference count by one.

Not generaly used by subclasses, mostly for collaboration with gutz::SmartPtr. Sometimes you need to call this though, see the documentation for gutz::SmartPtr

Definition at line 48 of file smartptr.h.

Referenced by TFImage::clear(), fBlendOverRGBA(), and Nrro::updateMinMax().

int Nrro::a int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6 = 0
const [inline, inherited]
 

Definition at line 687 of file nrro.h.

References Nrro::a(), and Nrro::getStride().

int Nrro::a int  i1,
int  i2,
int  i3,
int  i4 = 0
const [inline, inherited]
 

Definition at line 669 of file nrro.h.

References Nrro::a(), and Nrro::getStride().

int Nrro::a int  i1,
int  i2 = 0
const [inline, inherited]
 

fast addressing

Definition at line 386 of file nrro.h.

References Nrro::getStride().

Referenced by Nrro::a(), and Nrro::v().

void Nrro::addComment const std::string  key,
const std::string  comment
[inherited]
 

Definition at line 67 of file nrroComment.cpp.

References Nrro::_nrrd.

void Nrro::addComment const std::string  comment  )  [inherited]
 

Definition at line 59 of file nrroComment.cpp.

References Nrro::_nrrd.

Referenced by Nrro::setComment().

char* Nrro::axisName int  a  )  const [inline, inherited]
 

what is the name of the axis

Definition at line 198 of file nrro.h.

References Nrro::_nrrd.

Referenced by Nrro::printInfo().

float Nrro::axisSize int  a  )  const [inline, inherited]
 

what is the physical length of the axis?

Definition at line 191 of file nrro.h.

References Nrro::axisSpacing(), and Nrro::dim().

Referenced by Nrro::crop(), and Nrro::printInfo().

float Nrro::axisSizeNPad int  a  )  const [inherited]
 

what is the physical length, ignoring paded values?

Definition at line 243 of file nrro.cpp.

References Nrro::_nrrd, and Nrro::dimNPad().

Referenced by Nrro::getSizeV3(), and Nrro::printInfo().

float Nrro::axisSpacing int  a  )  const [inline, inherited]
 

what is the physical spacing between values along an axis

Definition at line 195 of file nrro.h.

References Nrro::_nrrd.

Referenced by Nrro::axisSize(), and Nrro::printInfo().

char* Nrro::axisUnit int  a  )  const [inline, inherited]
 

what are the units of the axis

Definition at line 200 of file nrro.h.

References Nrro::_nrrd.

Referenced by Nrro::printInfo().

gutz::vec2ui Nrro::axisValNPad int  a  )  const [inline, inherited]
 

ranges of unpadded values along an axis

Definition at line 202 of file nrro.h.

References Nrro::_pads.

template<class T>
NrroIter<T> Nrro::begin  )  [inline, inherited]
 

Definition at line 472 of file nrro.h.

void Nrro::copy const Nrro n  )  [protected, virtual, inherited]
 

copy a nrro object

Definition at line 297 of file nrro.cpp.

References Nrro::_kind, Nrro::_nrrd, Nrro::_pads, Nrro::_pos, Nrro::_strides, Nrro::_valid, Nrro::erase(), MAX_NRRO_ARRAY_DIM, and n.

Referenced by Nrro::Nrro(), and Nrro::operator=().

SmartPtr< Nrro > Nrro::crop int  min[],
int  max[]
[inherited]
 

crop, set axis pos to -1 if you want it left unchanged

make sure the 3D position is still correct.

update the pads so the axisSizeReal is correct

forcing an update

TODO: could make this smart enough to pad where necessary, even though this violates the semantics of "crop"

Definition at line 81 of file nrroGinsu.cpp.

References Nrro::_name, Nrro::_nrrd, Nrro::_pads, Nrro::_pos, Nrro::axisSize(), Nrro::dim(), Nrro::getKind(), Nrro::Nrro(), Nrro::NrroErr(), NrroSP, gutz::vec3f, x, and y.

Referenced by Nrro::cropPad().

NrroSP Nrro::cropPad int  min[],
int  max[],
int  bound = PAD,
double  padval = 0.0
[inherited]
 

pad and or crop to exact size

figure out sizes for crop and then padd

we croped the lower part of the axis, can't pad

need to pad down

we cropped the upper part of the axis, can't pad

just clamp the requested dims to the dims of this guy, ie. they must be inside

Definition at line 221 of file nrroGinsu.cpp.

References Nrro::_nrrd, gutz::clamp(), Nrro::crop(), Nrro::dim(), and NrroSP.

int Nrro::dim int  a  )  const [inline, inherited]
 

how many values along an axis?

Definition at line 187 of file nrro.h.

References Nrro::_nrrd.

int Nrro::dim  )  const [inline, inherited]
 

how many axies does this object contain?

Definition at line 185 of file nrro.h.

References Nrro::_nrrd.

Referenced by Nrro::axisSize(), TFImage::clear(), Nrro::crop(), Nrro::cropPad(), fBlendOverRGBA(), Nrro::forceMultiChannel(), getFormat(), Nrro::getSizeV3(), Nrro::guessKind(), height(), Nrro::insertAxis(), nChan(), Nrro::Nrro(), NrroImage(), Nrro::pad(), Nrro::printInfo(), Nrro::readPads(), Nrro::resample(), Nrro::setNrrd(), Nrro::slice(), Nrro::update(), width(), and Nrro::writePads().

int Nrro::dimNPad int  a  )  const [inline, inherited]
 

how many values are not from pading?

Definition at line 189 of file nrro.h.

References Nrro::_pads.

Referenced by Nrro::axisSizeNPad().

template<class T>
const NrroIter<T> Nrro::end  )  const [inline, inherited]
 

Definition at line 476 of file nrro.h.

References Nrro::size().

void Nrro::erase  )  [protected, virtual, inherited]
 

erase the nrrd and other stuff

Definition at line 323 of file nrro.cpp.

References Nrro::_nrrd, Nrro::_strides, Nrro::_valid, and MAX_NRRO_ARRAY_DIM.

Referenced by Nrro::copy(), and Nrro::~Nrro().

void NrroImage::fBlendOverRGBA NrroImageSP  ni  ) 
 

this one over ni

These also assume pre-alpha-multiplied color

Definition at line 87 of file nrroImage.cpp.

References gutz::Counted::_decCount(), gutz::Counted::_incCount(), blendOver(), Nrro::dim(), Nrro::getType(), gutz::SmartPtr< NrroImage >::isNull(), Nrro::NrroErr(), and retDispatchIter2.

void NrroImage::fBlendUnderRGBA NrroImageSP  ni  ) 
 

this one under ni

Definition at line 120 of file nrroImage.cpp.

int Nrro::forceMultiChannel  )  [inherited]
 

This makes all kinds of nrros multi-channel.

  • Images 3D: N channels + 2 spatial axes
  • Time Images 4D: N channels + 2 spatial + 1 time
  • Volumes 4D: N channels + 3 spatial axes
  • Time Volumes 5D: N channels + 3 spatial + 1 time
  • Unknown kinds are left alone. <nrroKind.cpp>

Definition at line 125 of file nrroKind.cpp.

References Nrro::_kind, Nrro::dim(), Nrro::IMAGE, Nrro::insertAxis(), Nrro::KIND_LAST, Nrro::KIND_NOT_SET, Nrro::KIND_UNKNOWN, Nrro::NrroDbg(), Nrro::TIME_SERIES, and Nrro::VOLUME.

Referenced by NrroImage().

std::string Nrro::getComment const std::string  key  )  [inherited]
 

Definition at line 46 of file nrroComment.cpp.

References Nrro::_nrrd, and string.

std::string Nrro::getComment int  i  )  [inherited]
 

Definition at line 36 of file nrroComment.cpp.

References Nrro::_nrrd, and string.

Referenced by Nrro::readKind(), Nrro::readName(), Nrro::readPads(), and Nrro::readPos().

void* Nrro::getData  )  const [inline, inherited]
 

Definition at line 177 of file nrro.h.

References Nrro::_nrrd.

Referenced by Nrro::__dbl::assn().

int NrroImage::getFormat  )  const [inline]
 

basically the number of channels

Definition at line 58 of file nrroImage.h.

References Nrro::dim().

int Nrro::getKind  )  const [inline, inherited]
 

Definition at line 107 of file nrro.h.

References Nrro::_kind.

Referenced by Nrro::crop(), and Nrro::pad().

gutz::vec2d Nrro::getMinMax  )  const [inline, inherited]
 

min/max values in nrro, r::x = min, r::y = max <nrroGinsu.cpp>

Definition at line 208 of file nrro.h.

References Nrro::_minmax.

std::string Nrro::getName  )  const [inline, inherited]
 

Definition at line 290 of file nrro.h.

References Nrro::_name.

Nrrd* Nrro::getNrrd  )  const [inline, inherited]
 

Definition at line 170 of file nrro.h.

References Nrro::_nrrd.

gutz::vec3f Nrro::getPos  )  const [inline, inherited]
 

Definition at line 217 of file nrro.h.

References Nrro::_pos.

gutz::vec3f Nrro::getSizeV3  )  const [inherited]
 

ignores padded part, doesn't work for time series 4D vols

regular n-channel image, or 4D time series image

3D volume or 4D time series volume

4D volume or 5D time series volume

sigh, we have to handle symantics here 2D image, or 3D time series image

Definition at line 260 of file nrro.cpp.

References Nrro::_kind, Nrro::axisSizeNPad(), Nrro::dim(), Nrro::IMAGE, Nrro::NrroDbg(), Nrro::TIME_SERIES, gutz::vec3f, gutz::vec3f_zero, and Nrro::VOLUME.

int Nrro::getStride int  a  )  const [inline, inherited]
 

strides for accessing fast!

Definition at line 206 of file nrro.h.

References Nrro::_strides.

Referenced by Nrro::a().

int Nrro::getType  )  const [inline, inherited]
 

Type of nrrd contained here.

From nrrdEnums.h, same as above You'll need this to get the correct iterator.

Definition at line 146 of file nrro.h.

References Nrro::_nrrd, and Nrro::UNKNOWN.

Referenced by Nrro::__dbl::assn(), TFImage::clear(), fBlendOverRGBA(), and Nrro::resample().

int Nrro::guessKind  )  const [inherited]
 

guess what kind of data we have

Definition at line 61 of file nrroKind.cpp.

References Nrro::_nrrd, Nrro::dim(), Nrro::IMAGE, Nrro::KIND_NOT_SET, Nrro::KIND_UNKNOWN, Nrro::NrroDbg(), Nrro::PROXY, Nrro::TIME_SERIES, and Nrro::VOLUME.

Referenced by Nrro::readNrrd().

int NrroImage::height  )  const [inline]
 

Definition at line 52 of file nrroImage.h.

References Nrro::dim().

void Nrro::initMembers  )  [protected, virtual, inherited]
 

initiallize member variables

Definition at line 202 of file nrro.cpp.

References Nrro::_kind, Nrro::_modified, Nrro::_nrrd, Nrro::_pads, Nrro::_pos, Nrro::_valid, Nrro::KIND_NOT_SET, MAX_NRRO_ARRAY_DIM, gutz::vec2ui, and gutz::vec3f_zero.

Referenced by Nrro::Nrro().

int Nrro::insertAxis unsigned int  axis  )  [inherited]
 

insert axis

Definition at line 300 of file nrroGinsu.cpp.

References Nrro::_nrrd, Nrro::_pads, Nrro::dim(), Nrro::NrroErr(), Nrro::setModified(), Nrro::update(), and gutz::vec2ui.

Referenced by Nrro::forceMultiChannel().

bool Nrro::isModified  )  const [inline, inherited]
 

has it been changed?

Definition at line 75 of file nrro.h.

References Nrro::_modified.

bool Nrro::isValid  )  const [inline, inherited]
 

does this nrro contain any usefull information?

Definition at line 69 of file nrro.h.

References Nrro::_valid.

Referenced by Nrro::printInfo().

template<class T>
NrroIter<T> Nrro::last  )  [inline, inherited]
 

Definition at line 474 of file nrro.h.

References Nrro::size().

int NrroImage::nChan  )  const [inline]
 

Definition at line 50 of file nrroImage.h.

References Nrro::dim().

void Nrro::NrroDbg const char *  s,
const char *  s2 = 0
const [inline, protected, inherited]
 

message for debugging purposes

Definition at line 608 of file nrro.h.

References Nrro::_name, and s.

Referenced by Nrro::forceMultiChannel(), Nrro::getSizeV3(), Nrro::guessKind(), Nrro::Nrro(), Nrro::readNrrd(), Nrro::readPads(), Nrro::readPos(), Nrro::saveNrrd(), Nrro::setComment(), and Nrro::setStrides().

void Nrro::NrroErr const char *  s,
const char *  s2 = 0
const [inline, protected, inherited]
 

send a real error message

send a real error message

Definition at line 593 of file nrro.h.

References Nrro::_name, and s.

Referenced by Nrro::crop(), fBlendOverRGBA(), Nrro::insertAxis(), NrroImage(), Nrro::pad(), Nrro::quantize(), Nrro::readNrrd(), Nrro::resample(), Nrro::saveNrrd(), Nrro::setComment(), and Nrro::slice().

int Nrro::numComments  )  const [inherited]
 

Definition at line 27 of file nrroComment.cpp.

References Nrro::_nrrd.

Referenced by Nrro::setComment().

Nrro::__dbl Nrro::operator() int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6 = 0
[inline, inherited]
 

Definition at line 711 of file nrro.h.

References Nrro::v().

double Nrro::operator() int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6 = 0
const [inline, inherited]
 

Definition at line 705 of file nrro.h.

References Nrro::v().

__dbl Nrro::operator() int  i1,
int  i2,
int  i3,
int  i4 = 0
[inline, inherited]
 

Definition at line 378 of file nrro.h.

References Nrro::v().

double Nrro::operator() int  i1,
int  i2,
int  i3,
int  i4 = 0
const [inline, inherited]
 

Definition at line 376 of file nrro.h.

References Nrro::v().

__dbl Nrro::operator() int  i1,
int  i2
[inline, inherited]
 

Definition at line 374 of file nrro.h.

References Nrro::v().

double Nrro::operator() int  i1,
int  i2
const [inline, inherited]
 

Definition at line 372 of file nrro.h.

References Nrro::v().

__dbl Nrro::operator() int  i1  )  [inline, inherited]
 

Definition at line 370 of file nrro.h.

References Nrro::v().

double Nrro::operator() int  i1  )  const [inline, inherited]
 

Definition at line 368 of file nrro.h.

References Nrro::v().

SmartPtr< Nrro > Nrro::pad int  min[],
int  max[],
int  bound = PAD,
double  padval = 0.0
[inherited]
 

be sure that min and max are valid values, "-1" for min would pad back 1 voxel!!!!

forcing an update

TODO: could make this smart enough to crop where needed! even though this violates the sematics of "pad"

TODO: shouldn't this handle the pos for back padding? set _pads so we know what part of the data is valid keep the real size correct

Definition at line 165 of file nrroGinsu.cpp.

References Nrro::_name, Nrro::_nrrd, Nrro::_pads, Nrro::dim(), Nrro::getKind(), Nrro::Nrro(), Nrro::NrroErr(), and NrroSP.

void Nrro::printInfo  )  const [inherited]
 

Print out what the nrro is, stderr right now.

Definition at line 397 of file nrro.cpp.

References Nrro::_name, Nrro::_pads, Nrro::_pos, Nrro::axisName(), Nrro::axisSize(), Nrro::axisSizeNPad(), Nrro::axisSpacing(), Nrro::axisUnit(), Nrro::dim(), Nrro::isValid(), Nrro::printKind(), and Nrro::printType().

void Nrro::printKind  )  const [inherited]
 

print kind to std::err

Definition at line 40 of file nrroKind.cpp.

References Nrro::_kind, Nrro::IMAGE, Nrro::KIND_NOT_SET, Nrro::KIND_UNKNOWN, Nrro::PROXY, Nrro::TIME_SERIES, and Nrro::VOLUME.

Referenced by Nrro::printInfo().

void Nrro::printType  )  const [inherited]
 

Definition at line 451 of file nrro.cpp.

References Nrro::_nrrd, Nrro::BLOCK, Nrro::CHAR, Nrro::DOUBLE, Nrro::FLOAT, Nrro::INT, Nrro::SHORT, Nrro::TYPE_LAST, Nrro::UCHAR, Nrro::UINT, Nrro::UNKNOWN, and Nrro::USHORT.

Referenced by Nrro::printInfo().

SmartPtr< Nrro > Nrro::quantize int  bits,
double  min = AIR_NAN,
double  max = AIR_NAN
[inherited]
 

Quantize, set min/max if you want to, otherwise we'll figure out what they are.

Definition at line 259 of file nrroGinsu.cpp.

References Nrro::_kind, Nrro::_name, Nrro::_nrrd, Nrro::_pads, Nrro::_pos, Nrro::Nrro(), Nrro::NrroErr(), and NrroSP.

void Nrro::readExtended  )  [protected, virtual, inherited]
 

Extended features: <nrroExtended.cpp> this next one updates the extended nrrd format by adding things like pos and pads to the comments these can be read in with the nrro after it has been saved.

These don't actually write the nrro to disk, they just update the comment fields

Definition at line 29 of file nrroExtended.cpp.

References Nrro::readKind(), Nrro::readName(), Nrro::readPads(), and Nrro::readPos().

Referenced by Nrro::readNrrd().

void Nrro::readKind  )  [protected, virtual, inherited]
 

Definition at line 96 of file nrroExtended.cpp.

References Nrro::_kind, Nrro::getComment(), Nrro::IMAGE, KIND_IMAGE_STR(), Nrro::KIND_NOT_SET, KIND_TIME_STR(), Nrro::KIND_UNKNOWN, KIND_UNKNOWN_STR(), KIND_VOLUME_STR(), NRRO_KIND_KEY, Nrro::PROXY, string, Nrro::TIME_SERIES, and Nrro::VOLUME.

Referenced by Nrro::readExtended().

void Nrro::readName  )  [protected, virtual, inherited]
 

Definition at line 221 of file nrroExtended.cpp.

References Nrro::_name, Nrro::getComment(), and NRRO_NAME_KEY.

Referenced by Nrro::readExtended().

int Nrro::readNrrd const char *  nrrdFileName,
bool  proxy = false
[virtual, inherited]
 

read returns 0 if read, 1 if error proxy nrro's don't have data, just dimension and type info

Definition at line 28 of file nrroIO.cpp.

References Nrro::_kind, Nrro::_name, Nrro::_valid, file, Nrro::guessKind(), Nrro::KIND_NOT_SET, Nrro::NrroDbg(), Nrro::NrroErr(), Nrro::readExtended(), Nrro::setNrrd(), and Nrro::writeExtended().

Referenced by Nrro::Nrro().

void Nrro::readPads  )  [protected, virtual, inherited]
 

Definition at line 147 of file nrroExtended.cpp.

References Nrro::_pads, Nrro::dim(), Nrro::getComment(), NRRO_PADS_KEY, Nrro::NrroDbg(), and string.

Referenced by Nrro::readExtended().

void Nrro::readPos  )  [protected, virtual, inherited]
 

Definition at line 191 of file nrroExtended.cpp.

References Nrro::_pos, Nrro::getComment(), NRRO_POS_KEY, Nrro::NrroDbg(), and string.

Referenced by Nrro::readExtended().

gutz::SmartPtr< Nrro > Nrro::resample float  pct = 1.0f  )  [inherited]
 

Definition at line 456 of file nrroGinsu.cpp.

References NrroSP.

gutz::SmartPtr< Nrro > Nrro::resample int  dims[],
const NrroKernel kern = CatmulRomKernel,
int  bound = BLEED,
int  typeOut = UNKNOWN
[inherited]
 

resample.

if dims[1] == -1 leave the axis alone can use any kind of kernel, if dims[i] == dim(i) than filter axis, but don't resize if typeOut == UKNOWN than output the same type of nrro

Definition at line 372 of file nrroGinsu.cpp.

References Nrro::_nrrd, Nrro::dim(), NrroKernel::getNrrdKernel(), NrroKernel::getParams(), Nrro::getType(), Nrro::Nrro(), Nrro::NrroErr(), NrroSP, and Nrro::UNKNOWN.

int Nrro::saveNrrd const char *  nrrdFileName  )  [virtual, inherited]
 

save returns 0 if read, 1 if error

Definition at line 80 of file nrroIO.cpp.

References Nrro::_nrrd, Nrro::NrroDbg(), Nrro::NrroErr(), and Nrro::writeExtended().

void Nrro::setAxisSpacing int  a,
float  s
[inline, inherited]
 

Definition at line 196 of file nrro.h.

References Nrro::_nrrd, and s.

void Nrro::setComment const std::string  key,
const std::string  comment
[inherited]
 

no comments yet, just add it

generate the comment

does exist, go find it

check each comment

what?? we should have detected that it wasn't there by now

else need to check if the comment already exists doesn't exist yet, just add it

otherwise nrrdCommentScan found the key+comment but we have to locate it ourselves, that is, find the index of the key+comment and set it to something else.

this uses a local function (above) to detect if the string has the key, but the key isn't just a word in the comment

Definition at line 148 of file nrroComment.cpp.

References Nrro::_nrrd, Nrro::addComment(), Nrro::NrroErr(), Nrro::numComments(), Nrro::setComment(), and stringHasKey().

void Nrro::setComment int  i,
const std::string  comment
[inherited]
 

have to be carefull here, nrrd might use malloc!, but we don't really know? Lesson: always use the library's creation deletion model

Definition at line 78 of file nrroComment.cpp.

References Nrro::_nrrd, and Nrro::NrroDbg().

Referenced by Nrro::setComment(), Nrro::writeKind(), Nrro::writeName(), Nrro::writePads(), and Nrro::writePos().

void Nrro::setKind int  kind  )  [inline, inherited]
 

set the kind of data, to make it a proxy try: setKind(getKind() | Nrro::PROXY); to make it "not" a PROXY try setKind(getKind() & (~Nrro::PROXY))

Definition at line 115 of file nrro.h.

References Nrro::_kind.

Referenced by NrroImage().

void Nrro::setModified bool  mod = true  )  [inline, inherited]
 

Definition at line 76 of file nrro.h.

References Nrro::_modified.

Referenced by Nrro::insertAxis(), Nrro::operator=(), and Nrro::update().

void Nrro::setName std::string  name  )  [inline, inherited]
 

Definition at line 291 of file nrro.h.

References Nrro::_name, and name.

void Nrro::setNrrd Nrrd *  n  )  [inherited]
 

TODO: read out pos, tc, and pads from comments

set the padds

Definition at line 371 of file nrro.cpp.

References Nrro::_nrrd, Nrro::_pads, Nrro::_pos, Nrro::_valid, Nrro::dim(), gutz::g_max(), MAX_NRRO_ARRAY_DIM, n, Nrro::setStrides(), and gutz::vec3f_zero.

Referenced by Nrro::Nrro(), and Nrro::readNrrd().

void Nrro::setPos gutz::vec3f  pos  )  [inline, inherited]
 

Definition at line 218 of file nrro.h.

References Nrro::_pos.

void Nrro::setStrides  )  [virtual, inherited]
 

set the strides, for fast access, usually you won't have to worry about this, when things change internally, this is called automatically, if you muck with the dimensions yourself be sure to update the strides

all start with 1

multiply by the one under you

zero out all others

Definition at line 340 of file nrro.cpp.

References Nrro::_nrrd, Nrro::_strides, MAX_NRRO_ARRAY_DIM, and Nrro::NrroDbg().

Referenced by Nrro::setNrrd(), and Nrro::update().

int Nrro::size  )  const [inherited]
 

total size of data

Definition at line 251 of file nrro.cpp.

References Nrro::_size.

Referenced by Nrro::end(), and Nrro::last().

NrroSP Nrro::slice int  axis,
int  pos
[inherited]
 

slice, get a slice on axis at pos

Definition at line 34 of file nrroGinsu.cpp.

References Nrro::_kind, Nrro::_name, Nrro::_nrrd, Nrro::dim(), Nrro::Nrro(), Nrro::NrroErr(), NrroSP, and Nrro::PROXY.

void Nrro::update  )  [virtual, inherited]
 

bring it up to date.

isModified() will be false after. Updates: strides, extended format, minmax only worry about this if you change something about this nrro, like values or it's size.

Definition at line 217 of file nrro.cpp.

References Nrro::_modified, Nrro::_nrrd, Nrro::_size, Nrro::_valid, Nrro::dim(), Nrro::setModified(), Nrro::setStrides(), Nrro::updateMinMax(), and Nrro::writeExtended().

Referenced by Nrro::insertAxis(), Nrro::Nrro(), and Nrro::operator=().

void Nrro::updateMinMax  )  [protected, inherited]
 

cache some slow to compute, but likely static values

we need a reference to ourselves to use an iterator internally!!!

Definition at line 351 of file nrroGinsu.cpp.

References gutz::Counted::_decCount(), gutz::Counted::_incCount(), Nrro::_minmax, Nrro::_nrrd, minmaxFunc(), and retDispatchIter1.

Referenced by Nrro::update().

Nrro::__dbl Nrro::v int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6 = 0
[inline, inherited]
 

Definition at line 699 of file nrro.h.

References Nrro::a().

double Nrro::v int  i1,
int  i2,
int  i3,
int  i4,
int  i5,
int  i6 = 0
const [inline, inherited]
 

Definition at line 693 of file nrro.h.

References Nrro::a().

Nrro::__dbl Nrro::v int  i1,
int  i2,
int  i3,
int  i4 = 0
[inline, inherited]
 

Definition at line 681 of file nrro.h.

References Nrro::a().

double Nrro::v int  i1,
int  i2,
int  i3,
int  i4 = 0
const [inline, inherited]
 

Definition at line 675 of file nrro.h.

References Nrro::a().

__dbl Nrro::v int  i1,
int  i2
[inline, inherited]
 

Definition at line 373 of file nrro.h.

References Nrro::a().

double Nrro::v int  i1,
int  i2
const [inline, inherited]
 

Definition at line 371 of file nrro.h.

References Nrro::a().

__dbl Nrro::v int  i1  )  [inline, inherited]
 

Definition at line 369 of file nrro.h.

double Nrro::v int  i1  )  const [inline, inherited]
 

Definition at line 367 of file nrro.h.

Referenced by Nrro::operator()().

template<class T>
T Nrro::val int  pos  )  const [inline, inherited]
 

Accessors.

Definition at line 636 of file nrro.h.

References Nrro::CHAR, Nrro::DOUBLE, Nrro::FLOAT, Nrro::INT, Nrro::SHORT, Nrro::UCHAR, Nrro::UINT, and Nrro::USHORT.

Referenced by Nrro::__dbl::val().

int NrroImage::width  )  const [inline]
 

Definition at line 51 of file nrroImage.h.

References Nrro::dim().

void Nrro::writeExtended  )  [protected, virtual, inherited]
 

Definition at line 40 of file nrroExtended.cpp.

References Nrro::writeKind(), Nrro::writeName(), Nrro::writePads(), and Nrro::writePos().

Referenced by Nrro::readNrrd(), Nrro::saveNrrd(), and Nrro::update().

void Nrro::writeKind  )  [protected, virtual, inherited]
 

Definition at line 62 of file nrroExtended.cpp.

References Nrro::_kind, Nrro::IMAGE, KIND_IMAGE_STR(), Nrro::KIND_NOT_SET, KIND_NOT_SET_STR(), KIND_PROXY_STR(), KIND_TIME_STR(), KIND_VOLUME_STR(), NRRO_KIND_KEY, Nrro::PROXY, Nrro::setComment(), string, Nrro::TIME_SERIES, and Nrro::VOLUME.

Referenced by Nrro::writeExtended().

void Nrro::writeName  )  [protected, virtual, inherited]
 

Definition at line 212 of file nrroExtended.cpp.

References Nrro::_name, NRRO_NAME_KEY, Nrro::setComment(), and string.

Referenced by Nrro::writeExtended().

void Nrro::writePads  )  [protected, virtual, inherited]
 

Definition at line 136 of file nrroExtended.cpp.

References Nrro::_pads, Nrro::dim(), NRRO_PADS_KEY, Nrro::setComment(), and string.

Referenced by Nrro::writeExtended().

void Nrro::writePos  )  [protected, virtual, inherited]
 

Definition at line 183 of file nrroExtended.cpp.

References Nrro::_pos, NRRO_POS_KEY, Nrro::setComment(), and string.

Referenced by Nrro::writeExtended().


Friends And Related Function Documentation

friend class SmartPtr [friend, inherited]
 

Definition at line 40 of file smartptr.h.

Referenced by Nrro::NrroIter< T >::NrroIter().

friend class SmartPtrRef [friend, inherited]
 

Definition at line 41 of file smartptr.h.


Member Data Documentation

std::string Nrro::_fileName [protected, inherited]
 

original file name

Definition at line 559 of file nrro.h.

int Nrro::_kind [protected, inherited]
 

Symantics - Kind of Nrro.

Definition at line 524 of file nrro.h.

Referenced by Nrro::copy(), Nrro::forceMultiChannel(), Nrro::getKind(), Nrro::getSizeV3(), Nrro::initMembers(), Nrro::printKind(), Nrro::quantize(), Nrro::readKind(), Nrro::readNrrd(), Nrro::setKind(), Nrro::slice(), and Nrro::writeKind().

gutz::vec2d Nrro::_minmax [protected, inherited]
 

Definition at line 564 of file nrro.h.

Referenced by Nrro::getMinMax(), and Nrro::updateMinMax().

bool Nrro::_modified [protected, inherited]
 

Definition at line 556 of file nrro.h.

Referenced by Nrro::initMembers(), Nrro::isModified(), Nrro::setModified(), and Nrro::update().

std::string Nrro::_name [protected, inherited]
 

does he have a name

Definition at line 540 of file nrro.h.

Referenced by Nrro::crop(), Nrro::getName(), Nrro::NrroDbg(), Nrro::NrroErr(), Nrro::pad(), Nrro::printInfo(), Nrro::quantize(), Nrro::readName(), Nrro::readNrrd(), Nrro::setName(), Nrro::slice(), and Nrro::writeName().

Nrrd* Nrro::_nrrd [protected, inherited]
 

the nrrd struct, from teem

Definition at line 516 of file nrro.h.

Referenced by Nrro::addComment(), Nrro::axisName(), Nrro::axisSizeNPad(), Nrro::axisSpacing(), Nrro::axisUnit(), Nrro::copy(), Nrro::crop(), Nrro::cropPad(), Nrro::dim(), Nrro::erase(), Nrro::getComment(), Nrro::getData(), Nrro::getNrrd(), Nrro::getType(), Nrro::guessKind(), Nrro::initMembers(), Nrro::insertAxis(), Nrro::Nrro(), Nrro::numComments(), Nrro::pad(), Nrro::printType(), Nrro::quantize(), Nrro::resample(), Nrro::saveNrrd(), Nrro::setAxisSpacing(), Nrro::setComment(), Nrro::setNrrd(), Nrro::setStrides(), Nrro::slice(), Nrro::update(), and Nrro::updateMinMax().

gutz::arrayo1v2ui Nrro::_pads [protected, inherited]
 

if padded, where is the "real" data

Definition at line 529 of file nrro.h.

Referenced by Nrro::axisValNPad(), Nrro::copy(), Nrro::crop(), Nrro::dimNPad(), Nrro::initMembers(), Nrro::insertAxis(), Nrro::Nrro(), Nrro::pad(), Nrro::printInfo(), Nrro::quantize(), Nrro::readPads(), Nrro::setNrrd(), and Nrro::writePads().

gutz::vec3f Nrro::_pos [protected, inherited]
 

what is the spatial position of this data, may not always be relevant

Definition at line 535 of file nrro.h.

Referenced by Nrro::copy(), Nrro::crop(), Nrro::getPos(), Nrro::initMembers(), Nrro::NrroIter< T >::NrroIter(), Nrro::printInfo(), Nrro::quantize(), Nrro::readPos(), Nrro::setNrrd(), Nrro::setPos(), and Nrro::writePos().

unsigned int Nrro::_size [protected, inherited]
 

Definition at line 565 of file nrro.h.

Referenced by Nrro::size(), and Nrro::update().

int Nrro::_strides[MAX_NRRO_ARRAY_DIM] [protected, inherited]
 

strides for easy/fast access

Definition at line 552 of file nrro.h.

Referenced by Nrro::copy(), Nrro::erase(), Nrro::getStride(), Nrro::Nrro(), and Nrro::setStrides().

bool Nrro::_valid [protected, inherited]
 

does this guy actuall contain something usefull?

Definition at line 555 of file nrro.h.

Referenced by Nrro::copy(), Nrro::erase(), Nrro::initMembers(), Nrro::isValid(), Nrro::Nrro(), Nrro::readNrrd(), Nrro::setNrrd(), and Nrro::update().


The documentation for this class was generated from the following files:
Send questions, comments, and bug reports to:
jmk