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

nrroUtil.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 /// NrroUtil.h
00019 
00020 #ifndef __NRRO_UTILITES_DOT_H
00021 #define __NRRO_UTILITES_DOT_H
00022 
00023 #include "nrro.h"
00024 #include "nrroKernel.h"
00025 
00026 ///////////////////////////////////////////////////////////////////////////
00027 /// Reshape a Nrro Image, input should be an image!!!
00028 /// basically converts a volume slice into an image with arbitrary zoom
00029 ///  assumes that:
00030 ///  1) min and max pos are relative to the spatial dimensions of the window 
00031 ///     you want to display image (for instance), describing the window position 
00032 ///     inside the image data.  This function respects
00033 ///     the spatial aspect ratio of the image (pixels can be anisotropic),
00034 ///     so position (1,1) could be outside the image, but on only for one of 
00035 ///     it's axes, the shortest one spatially.  (0,0) is always on the image.
00036 ///  2) If you specify positions greater that (1,1) or less than (0,0), ie.
00037 ///     positions out size of it, the image will be padded respectively.
00038 ///  3) you are requesting an image that is a specific size
00039 ///  4) the return image will have isotropic pixels.
00040 ///  5) output image will be multi-channel, even if input is scalar ex.(1,sx,sy)
00041 ///
00042 ///  What's happening?
00043 ///   the image is cropped and/or padded based on the min and max size
00044 ///   then it is resampled to the correct size
00045 ///
00046 ///  Does not handle Proxy data or Time Series images
00047 
00048 /// this one respects the aspect ratio (as described above)
00049 NrroSP reshapeNrroImageA(const NrroSP n,
00050                          /// size of image you want back
00051                          const gutz::vec2i size,    
00052                          /// [0-1] min pos, relative to greatest axis
00053                          const gutz::vec2f minPos = gutz::vec2f_zero,
00054                          /// [0-1] max pos, relative to greatest axis
00055                          const gutz::vec2f maxPos = gutz::vec2f_one, 
00056                          /// Kernel you want for resampling
00057                          const NrroKernel &k = CatmulRomKernel);
00058 
00059 /// this one ignores  the aspect ratio ... TODO: implement that !!!
00060 
00061 
00062 ////////////////////////////////////////////////////////////////////////////
00063 /// Set a multi-channel nrro to some vector of values, the types should 
00064 /// match but they dont have to!  The vectors lenght should be at least the
00065 /// size of the nrroSp's dim(0)
00066 ////////////////////////////////////////////////////////////////////////////
00067 template<class T>
00068 void nrroSet(NrroSP n, const T *vvec);
00069 /// use this if you have the iterator already
00070 template<class NT, class VT>
00071 void nrroSet(Nrro::NrroIter<NT> ni, const VT *v);
00072 
00073 #endif
00074 

Send questions, comments, and bug reports to:
jmk