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

Nrro Class Reference

#include <nrro.h>

Inheritance diagram for Nrro:

gutz::Counted NrroImage TFImage List of all members.

Detailed Description

NRRO, NRRd Object, "Not Really Raster Object".

TODO: move to GUTZ ???
TODO: only node centered data? this means that a axis of length 1 has spatial size 0 ... no matter the spacing!

Definition at line 49 of file nrro.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
double operator() (int i1) const
__dbl v (int i1)
__dbl operator() (int i1)
double v (int i1, int i2) const
double operator() (int i1, int i2) const
__dbl v (int i1, int i2)
__dbl operator() (int i1, int i2)
double v (int i1, int i2, int i3, int i4=0) const
double operator() (int i1, int i2, int i3, int i4=0) const
__dbl v (int i1, int i2, int i3, int i4=0)
__dbl operator() (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
double operator() (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)
__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


Public Member Functions

 Nrro ()
 Nrro (int typeEnum, int sx)
 Nrro (int typeEnum, int sx, int sy)
 Nrro (int typeEnum, int sx, int sy, int sz)
 Nrro (int typeEnum, int sx, int sy, int sz, int sw)
 Nrro (int typeEnum, int s1, int s2, int s3, int s4, int s5)
 Nrro (int typeEnum, int dim, int sz[])
 Nrro (const Nrro &n)
 Nrro (const char *nrrdFileName, bool proxy=false)
 Nrro (Nrrd *n)
virtual ~Nrro ()
void operator= (const Nrro &n)
 assignment

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 Nrro::NRRO_BOUNDARY_BEHAVIORS
 

pad, pad out the volume.

Enumeration values:
PAD 
BLEED 
WRAP 

Definition at line 245 of file nrro.h.

enum Nrro::NRRO_KINDS
 

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
 

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

Nrro::Nrro  ) 
 

Definition at line 48 of file nrro.cpp.

References _nrrd, _strides, _valid, initMembers(), MAX_NRRO_ARRAY_DIM, NrroDbg(), and update().

Referenced by crop(), pad(), quantize(), resample(), and slice().

Nrro::Nrro int  typeEnum,
int  sx
 

Definition at line 98 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro int  typeEnum,
int  sx,
int  sy
 

Definition at line 113 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro int  typeEnum,
int  sx,
int  sy,
int  sz
 

Definition at line 128 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro int  typeEnum,
int  sx,
int  sy,
int  sz,
int  sw
 

Definition at line 143 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro int  typeEnum,
int  s1,
int  s2,
int  s3,
int  s4,
int  s5
 

Definition at line 158 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro int  typeEnum,
int  dim,
int  sz[]
 

Definition at line 173 of file nrro.cpp.

References _nrrd, _pads, _valid, dim(), initMembers(), and update().

Nrro::Nrro const Nrro n  ) 
 

Definition at line 63 of file nrro.cpp.

References _nrrd, _valid, copy(), initMembers(), n, and update().

Nrro::Nrro const char *  nrrdFileName,
bool  proxy = false
 

Definition at line 73 of file nrro.cpp.

References _nrrd, _valid, initMembers(), readNrrd(), and update().

Nrro::Nrro Nrrd *  n  ) 
 

Definition at line 89 of file nrro.cpp.

References _nrrd, _valid, initMembers(), n, setNrrd(), and update().

Nrro::~Nrro  )  [virtual]
 

Definition at line 189 of file nrro.cpp.

References erase().


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(), NrroImage::fBlendOverRGBA(), and 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(), NrroImage::fBlendOverRGBA(), and updateMinMax().

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

Definition at line 687 of file nrro.h.

References a(), and getStride().

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

Definition at line 669 of file nrro.h.

References a(), and getStride().

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

fast addressing

Definition at line 386 of file nrro.h.

References getStride().

Referenced by a(), and v().

void Nrro::addComment const std::string  key,
const std::string  comment
 

Definition at line 67 of file nrroComment.cpp.

References _nrrd.

void Nrro::addComment const std::string  comment  ) 
 

Definition at line 59 of file nrroComment.cpp.

References _nrrd.

Referenced by setComment().

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

what is the name of the axis

Definition at line 198 of file nrro.h.

References _nrrd.

Referenced by printInfo().

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

what is the physical length of the axis?

Definition at line 191 of file nrro.h.

References axisSpacing(), and dim().

Referenced by crop(), and printInfo().

float Nrro::axisSizeNPad int  a  )  const
 

what is the physical length, ignoring paded values?

Definition at line 243 of file nrro.cpp.

References _nrrd, and dimNPad().

Referenced by getSizeV3(), and printInfo().

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

what is the physical spacing between values along an axis

Definition at line 195 of file nrro.h.

References _nrrd.

Referenced by axisSize(), and printInfo().

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

what are the units of the axis

Definition at line 200 of file nrro.h.

References _nrrd.

Referenced by printInfo().

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

ranges of unpadded values along an axis

Definition at line 202 of file nrro.h.

References _pads.

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

Definition at line 472 of file nrro.h.

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

copy a nrro object

Definition at line 297 of file nrro.cpp.

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

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

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

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 _name, _nrrd, _pads, _pos, axisSize(), dim(), getKind(), Nrro(), NrroErr(), NrroSP, gutz::vec3f, x, and y.

Referenced by cropPad().

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

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 _nrrd, gutz::clamp(), crop(), dim(), and NrroSP.

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

how many values along an axis?

Definition at line 187 of file nrro.h.

References _nrrd.

int Nrro::dim  )  const [inline]
 

how many axies does this object contain?

Definition at line 185 of file nrro.h.

References _nrrd.

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

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

how many values are not from pading?

Definition at line 189 of file nrro.h.

References _pads.

Referenced by axisSizeNPad().

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

Definition at line 476 of file nrro.h.

References size().

void Nrro::erase  )  [protected, virtual]
 

erase the nrrd and other stuff

Definition at line 323 of file nrro.cpp.

References _nrrd, _strides, _valid, and MAX_NRRO_ARRAY_DIM.

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

int Nrro::forceMultiChannel  ) 
 

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 _kind, dim(), IMAGE, insertAxis(), KIND_LAST, KIND_NOT_SET, KIND_UNKNOWN, NrroDbg(), TIME_SERIES, and VOLUME.

Referenced by NrroImage::NrroImage().

std::string Nrro::getComment const std::string  key  ) 
 

Definition at line 46 of file nrroComment.cpp.

References _nrrd, and string.

std::string Nrro::getComment int  i  ) 
 

Definition at line 36 of file nrroComment.cpp.

References _nrrd, and string.

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

void* Nrro::getData  )  const [inline]
 

Definition at line 177 of file nrro.h.

References _nrrd.

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

int Nrro::getKind  )  const [inline]
 

Definition at line 107 of file nrro.h.

References _kind.

Referenced by crop(), and pad().

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

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

Definition at line 208 of file nrro.h.

References _minmax.

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

Definition at line 290 of file nrro.h.

References _name.

Nrrd* Nrro::getNrrd  )  const [inline]
 

Definition at line 170 of file nrro.h.

References _nrrd.

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

Definition at line 217 of file nrro.h.

References _pos.

gutz::vec3f Nrro::getSizeV3  )  const
 

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 _kind, axisSizeNPad(), dim(), IMAGE, NrroDbg(), TIME_SERIES, gutz::vec3f, gutz::vec3f_zero, and VOLUME.

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

strides for accessing fast!

Definition at line 206 of file nrro.h.

References _strides.

Referenced by a().

int Nrro::getType  )  const [inline]
 

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 _nrrd, and UNKNOWN.

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

int Nrro::guessKind  )  const
 

guess what kind of data we have

Definition at line 61 of file nrroKind.cpp.

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

Referenced by readNrrd().

void Nrro::initMembers  )  [protected, virtual]
 

initiallize member variables

Definition at line 202 of file nrro.cpp.

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

Referenced by Nrro().

int Nrro::insertAxis unsigned int  axis  ) 
 

insert axis

Definition at line 300 of file nrroGinsu.cpp.

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

Referenced by forceMultiChannel().

bool Nrro::isModified  )  const [inline]
 

has it been changed?

Definition at line 75 of file nrro.h.

References _modified.

bool Nrro::isValid  )  const [inline]
 

does this nrro contain any usefull information?

Definition at line 69 of file nrro.h.

References _valid.

Referenced by printInfo().

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

Definition at line 474 of file nrro.h.

References size().

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

message for debugging purposes

Definition at line 608 of file nrro.h.

References _name, and s.

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

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

send a real error message

send a real error message

Definition at line 593 of file nrro.h.

References _name, and s.

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

int Nrro::numComments  )  const
 

Definition at line 27 of file nrroComment.cpp.

References _nrrd.

Referenced by setComment().

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

Definition at line 711 of file nrro.h.

References v().

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

Definition at line 705 of file nrro.h.

References v().

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

Definition at line 378 of file nrro.h.

References v().

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

Definition at line 376 of file nrro.h.

References v().

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

Definition at line 374 of file nrro.h.

References v().

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

Definition at line 372 of file nrro.h.

References v().

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

Definition at line 370 of file nrro.h.

References v().

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

Definition at line 368 of file nrro.h.

References v().

void Nrro::operator= const Nrro n  ) 
 

assignment

Definition at line 195 of file nrro.cpp.

References copy(), n, setModified(), and update().

SmartPtr< Nrro > Nrro::pad 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!!!!

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 _name, _nrrd, _pads, dim(), getKind(), Nrro(), NrroErr(), and NrroSP.

void Nrro::printInfo  )  const
 

Print out what the nrro is, stderr right now.

Definition at line 397 of file nrro.cpp.

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

void Nrro::printKind  )  const
 

print kind to std::err

Definition at line 40 of file nrroKind.cpp.

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

Referenced by printInfo().

void Nrro::printType  )  const
 

Definition at line 451 of file nrro.cpp.

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

Referenced by printInfo().

SmartPtr< Nrro > Nrro::quantize 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.

Definition at line 259 of file nrroGinsu.cpp.

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

void Nrro::readExtended  )  [protected, virtual]
 

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 readKind(), readName(), readPads(), and readPos().

Referenced by readNrrd().

void Nrro::readKind  )  [protected, virtual]
 

Definition at line 96 of file nrroExtended.cpp.

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

Referenced by readExtended().

void Nrro::readName  )  [protected, virtual]
 

Definition at line 221 of file nrroExtended.cpp.

References _name, getComment(), and NRRO_NAME_KEY.

Referenced by readExtended().

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

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 _kind, _name, _valid, file, guessKind(), KIND_NOT_SET, NrroDbg(), NrroErr(), readExtended(), setNrrd(), and writeExtended().

Referenced by Nrro().

void Nrro::readPads  )  [protected, virtual]
 

Definition at line 147 of file nrroExtended.cpp.

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

Referenced by readExtended().

void Nrro::readPos  )  [protected, virtual]
 

Definition at line 191 of file nrroExtended.cpp.

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

Referenced by readExtended().

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

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
 

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 _nrrd, dim(), NrroKernel::getNrrdKernel(), NrroKernel::getParams(), getType(), Nrro(), NrroErr(), NrroSP, and UNKNOWN.

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

save returns 0 if read, 1 if error

Definition at line 80 of file nrroIO.cpp.

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

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

Definition at line 196 of file nrro.h.

References _nrrd, and s.

void Nrro::setComment const std::string  key,
const std::string  comment
 

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 _nrrd, addComment(), NrroErr(), numComments(), setComment(), and stringHasKey().

void Nrro::setComment int  i,
const std::string  comment
 

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 _nrrd, and NrroDbg().

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

void Nrro::setKind int  kind  )  [inline]
 

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 _kind.

Referenced by NrroImage::NrroImage().

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

Definition at line 76 of file nrro.h.

References _modified.

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

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

Definition at line 291 of file nrro.h.

References _name, and name.

void Nrro::setNrrd Nrrd *  n  ) 
 

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

set the padds

Definition at line 371 of file nrro.cpp.

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

Referenced by Nrro(), and readNrrd().

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

Definition at line 218 of file nrro.h.

References _pos.

void Nrro::setStrides  )  [virtual]
 

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 _nrrd, _strides, MAX_NRRO_ARRAY_DIM, and NrroDbg().

Referenced by setNrrd(), and update().

int Nrro::size  )  const
 

total size of data

Definition at line 251 of file nrro.cpp.

References _size.

Referenced by end(), and last().

NrroSP Nrro::slice int  axis,
int  pos
 

slice, get a slice on axis at pos

Definition at line 34 of file nrroGinsu.cpp.

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

void Nrro::update  )  [virtual]
 

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 _modified, _nrrd, _size, _valid, dim(), setModified(), setStrides(), updateMinMax(), and writeExtended().

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

void Nrro::updateMinMax  )  [protected]
 

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(), _minmax, _nrrd, minmaxFunc(), and retDispatchIter1.

Referenced by update().

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

Definition at line 699 of file nrro.h.

References a().

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

Definition at line 693 of file nrro.h.

References a().

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

Definition at line 681 of file nrro.h.

References a().

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

Definition at line 675 of file nrro.h.

References a().

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

Definition at line 373 of file nrro.h.

References a().

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

Definition at line 371 of file nrro.h.

References a().

__dbl Nrro::v int  i1  )  [inline]
 

Definition at line 369 of file nrro.h.

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

Definition at line 367 of file nrro.h.

Referenced by operator()().

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

Accessors.

Definition at line 636 of file nrro.h.

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

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

void Nrro::writeExtended  )  [protected, virtual]
 

Definition at line 40 of file nrroExtended.cpp.

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

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

void Nrro::writeKind  )  [protected, virtual]
 

Definition at line 62 of file nrroExtended.cpp.

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

Referenced by writeExtended().

void Nrro::writeName  )  [protected, virtual]
 

Definition at line 212 of file nrroExtended.cpp.

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

Referenced by writeExtended().

void Nrro::writePads  )  [protected, virtual]
 

Definition at line 136 of file nrroExtended.cpp.

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

Referenced by writeExtended().

void Nrro::writePos  )  [protected, virtual]
 

Definition at line 183 of file nrroExtended.cpp.

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

Referenced by 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]
 

original file name

Definition at line 559 of file nrro.h.

int Nrro::_kind [protected]
 

Symantics - Kind of Nrro.

Definition at line 524 of file nrro.h.

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

gutz::vec2d Nrro::_minmax [protected]
 

Definition at line 564 of file nrro.h.

Referenced by getMinMax(), and updateMinMax().

bool Nrro::_modified [protected]
 

Definition at line 556 of file nrro.h.

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

std::string Nrro::_name [protected]
 

does he have a name

Definition at line 540 of file nrro.h.

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

Nrrd* Nrro::_nrrd [protected]
 

the nrrd struct, from teem

Definition at line 516 of file nrro.h.

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

gutz::arrayo1v2ui Nrro::_pads [protected]
 

if padded, where is the "real" data

Definition at line 529 of file nrro.h.

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

gutz::vec3f Nrro::_pos [protected]
 

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

Definition at line 535 of file nrro.h.

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

unsigned int Nrro::_size [protected]
 

Definition at line 565 of file nrro.h.

Referenced by size(), and update().

int Nrro::_strides[MAX_NRRO_ARRAY_DIM] [protected]
 

strides for easy/fast access

Definition at line 552 of file nrro.h.

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

bool Nrro::_valid [protected]
 

does this guy actuall contain something usefull?

Definition at line 555 of file nrro.h.

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


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