IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1663


Ignore:
Timestamp:
Aug 30, 2004, 3:32:34 PM (22 years ago)
Author:
Paul Price
Message:

Added parameters to psKernelGenerate, and synched image region
specification for psImageSubset, psImageTrim, psImageReadSection and
psImageSlice.

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r1646 r1663  
    263263\item Changed the order of some \code{psList} function arguments to
    264264  match that of \code{psMetadata}.
    265 
     265\item \code{psLogSetDestination} return type changed to \code{bool}.
     266\item \code{psImage.nChildren} and \code{.children} changed to
     267  \code{psArray *children}.
     268\item Added extra input parameters to \code{psKernelGenerate}:
     269  \code{psVector *tShifts} and \code{bool relative}.
     270\item Synched \code{psImageSubset}, \code{psImageTrim},
     271  \code{psImageReadSection} and \code{psImageSlice} to use a
     272  consistent region specification: \code{x0,y0,x1,y1}, where \code{x1}
     273  and \code{y1} are exclusive, and may be negative.
    266274\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r1662 r1663  
    1 %%% $Id: psLibSDRS.tex,v 1.95 2004-08-30 21:48:03 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.96 2004-08-31 01:32:34 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    23002300
    23012301\begin{verbatim}
    2302 psImage *psImageSubset(const psImage *image, int nx, int ny, int x0, int y0);
     2302psImage *psImageSubset(const psImage *image, int x0, int y0, int x1, int y1);
    23032303\end{verbatim}
    23042304Define a subimage of the specified area of the given image.  This
    23052305function must raise an error if the requested subset area lies outside
    23062306of the parent image and return \code{NULL}.  The argument \code{image}
    2307 is the parent image, \code{nx,ny} specify the dimensions of the
    2308 desired subraster, and \code{x0, y0} specify the starting pixel of the
    2309 subraster.  The entire subraster must be contained within the raster
    2310 of the parent image.  Note that the \code{refCounter} for the parent
    2311 should be incremented.  This function must be defined for the
    2312 following types: \code{psU8}, \code{psU16}, \code{psS8}, \code{psS16},
    2313 \code{psF32}, \code{psF64}, \code{psC32}, \code{psC64}.
     2307is the parent image, \code{x0, y0} specify the starting pixel of the
     2308subraster, and \code{x1,y1} specify the extent of the desired
     2309subraster.  Note that the row and column of this ``upper right-hand
     2310corner'' are \textit{NOT} included in the region.  In the event that
     2311\code{x1} or \code{y1} are negative, they shall be interpreted as
     2312being relative to the size of the parent image in that dimension.  The
     2313entire subraster must be contained within the raster of the parent
     2314image.  Note that the \code{refCounter} for the parent should be
     2315incremented.  This function must be defined for the following types:
     2316\code{psU8}, \code{psU16}, \code{psS8}, \code{psS16}, \code{psF32},
     2317\code{psF64}, \code{psC32}, \code{psC64}.
    23142318
    23152319\begin{verbatim}
     
    23402344\end{verbatim}
    23412345Trim the specified \code{image} in-place, which involves shuffling the
    2342 pixels around in memory.  The pixels in the region
    2343 \code{[x0:x1,y0:y1]} (inclusive) shall consist the output image.
     2346pixels around in memory.  The region to be kept is defined by the
     2347lower-left corner, \code{x0,y0}, and the upper-right corner,
     2348\code{x1,y1}.  Note that the row and column of the ``upper right-hand
     2349corner'' are \textit{NOT} included in the region.  In the event that
     2350\code{x1} or \code{y1} are negative, they shall be interpreted as
     2351being relative to the size of the parent image in that dimension.
    23442352
    23452353The function shall generate an error if the specified region is
     
    23562364} psImageCutDirection;
    23572365
    2358 psVector *psImageSlice(psVector *out,
    2359                        psVector *coords,
    2360                        const psImage *input,
    2361                        const psImage *mask,
    2362                        unsigned int maskVal,
    2363                        unsigned int x,
    2364                        unsigned int y,
    2365                        unsigned int nx,
    2366                        unsigned int ny,
    2367                        psImageCutDirection direction,
    2368                        const psStats *stats);
     2366psVector *psImageSlice(psVector *out, psVector *coords, const psImage *input,
     2367                       const psImage *mask, unsigned int maskVal, int x0, int y0,
     2368                       int x1, int y1, psImageCutDirection direction, const psStats *stats);
    23692369\end{verbatim}
    23702370Extract pixels from rectlinear region to a vector (array of floats).
    2371 The output vector contains either \code{nx} or \code{ny} elements,
    2372 based on the value of the direction: e.g., if \code{direction} is
    2373 \code{PS_CUT_X_POS}, there are \code{nx} elements.  The input region
    2374 is collapsed in the perpendicular direction, and each element of the
    2375 output vectors is derived from the statistics of the pixels at that
    2376 direction coordinate.  The statistic used to derive the output vector
    2377 value is specified by \code{stats}.  If \code{coords} is not
    2378 \code{NULL}, the calculated coordinates along the slice are returned
    2379 in this vector.  Only one of the statistics choices may be specified,
    2380 otherwise the function must return an error.  This function must be
    2381 defined for the following types: \code{psS8}, \code{psU16},
    2382 \code{psF32}, \code{psF64}.
     2371The output vector contains either \code{x1-x0} or \code{y1-y0}
     2372elements, based on the value of the direction: e.g., if
     2373\code{direction} is \code{PS_CUT_X_POS}, there are \code{x1-x0}
     2374elements.  The region to be ``sliced'' is defined by the lower-left
     2375corner, \code{x0,y0}, and the upper-right corner, \code{x1,y1}.  Note
     2376that the row and column of the ``upper right-hand corner'' are
     2377\textit{NOT} included in the region.  In the event that \code{x1} or
     2378\code{y1} are negative, they shall be interpreted as being relative to
     2379the size of the parent image in that dimension.
     2380
     2381The input region is collapsed in the direction perpendicular to that
     2382specified by \code{direction}, and each element of the output vectors
     2383is derived from the statistics of the pixels at that direction
     2384coordinate.  The statistic used to derive the output vector value is
     2385specified by \code{stats}.  If \code{coords} is not \code{NULL}, the
     2386calculated coordinates along the slice are returned in this vector.
     2387Only one of the statistics choices may be specified, otherwise the
     2388function must return an error.  This function must be defined for the
     2389following types: \code{psS8}, \code{psU16}, \code{psF32},
     2390\code{psF64}.
    23832391
    23842392\begin{verbatim}
     
    25692577
    25702578\begin{verbatim}
    2571 psImage *psImageReadSection(psImage *output, int x0, int y0, int nx, int ny, int z,
     2579psImage *psImageReadSection(psImage *output, int x0, int y0, int x1, int y1, int z,
    25722580                            const char *extname, int extnum, const char *filename);
    25732581\end{verbatim}
     
    25752583wrapper to the FITS library function.  The input parameters allow a
    25762584full image or a subimage to be read.  The starting pixel of the region
    2577 is specified by \code{x,y}, while the dimensions of the requested
    2578 region are specified by \code{nx,ny}.  A negative value for either of
    2579 \code{nx} or \code{ny} specifies the size of the region to be read
    2580 counting down from the end of the array.  In other words, the implied
    2581 value of \code{nx} is:
    2582 \begin{verbatim}
    2583 nx = (nx > 0) ? nx : image.ncols - x + nx;
    2584 \end{verbatim}
     2585is specified by \code{x0,y0}, while the upper right-hand corner of the
     2586requested region is specified by \code{x1,y1}.  A negative value for
     2587either of \code{x1} or \code{y2} specifies the size of the region to
     2588be read counting down from the end of the array.
     2589
    25852590If the native image is a cube, the value of z specifies the requested
    25862591slice of the image.  The data is read from the extension specified by
     
    29712976The API shall be the following:
    29722977\begin{verbatim}
    2973 psKernel *psKernelGenerate(const psVector *xShifts, const psVector *yShifts);
     2978psKernel *psKernelGenerate(const psVector *tShifts, const psVector *xShifts,
     2979                           const psVector *yShifts, bool relative);
    29742980\end{verbatim}
    29752981
    29762982The vectors \code{xShifts} and \code{yShifts}, which are a list of
    2977 shifts relative to some starting point, will be supplied by the user.
    2978 The elements of the vectors should be of an integer type; otherwise
    2979 the values shall be truncated to integers.  The output kernel shall be
    2980 normalized such that the sum over the kernel is unity.
    2981 
    2982 If the vectors are not of the same number of elements, then the
     2983shifts made at the times \code{tShifts}, are used to construct the
     2984appropriate kernel.  If \code{relative} is \code{true}, then each
     2985shift is to be interpreted relative the shift made before; if
     2986\code{relative} is \code{false}, then the shifts are to be interpreted
     2987relative to some starting point.  The elements of the vectors should
     2988be of an integer type; otherwise the values shall be truncated to
     2989integers.  The output kernel shall be normalized such that the sum
     2990over the kernel is unity.
     2991
     2992If the vectors are not all of the same number of elements, then the
    29832993function shall generate a warning shall be generated, following which,
    29842994the longer vector trimmed to the length of the shorter, and the
Note: See TracChangeset for help on using the changeset viewer.