Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends
vimt3d_vil3d_v3i_image Class Reference

#include <vimt3d_vil3d_v3i.h>

Inheritance diagram for vimt3d_vil3d_v3i_image:
Inheritance graph
[legend]

List of all members.

Classes

struct  header_t
 Storage type for header information when the whole image has not yet been loaded. More...

Public Member Functions

virtual ~vimt3d_vil3d_v3i_image ()
virtual unsigned nplanes () const
 Dimensions: nplanes x ni x nj x nk.
virtual unsigned ni () const
 Dimensions: nplanes x ni x nj x nk.
virtual unsigned nj () const
 Dimensions: nplanes x ni x nj x nk.
virtual unsigned nk () const
 Dimensions: nplanes x ni x nj x nk.
virtual enum vil_pixel_format pixel_format () const
 Pixel Format.
virtual bool set_voxel_size (float i, float j, float k)
 Set the size of the each pixel in the i,j,k directions.
const vimt3d_transform_3dworld2im () const
 Get full world to image transform.
void set_world2im (const vimt3d_transform_3d &tr)
 Set full world to image transform.
virtual vil3d_image_view_base_sptr get_copy_view (unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk) const
 Create a read/write view of a copy of this data.
virtual vil3d_image_view_base_sptr get_view (unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk) const
 Create a read/write view of a copy of this data.
virtual bool put_view (const vil3d_image_view_base &im, unsigned i0, unsigned j0, unsigned k0)
 Put the data in this view back into the image source.
virtual char const * file_format () const
 Return a string describing the file format.
virtual bool get_property (char const *label, void *property_value=0) const
 Extra property information.
vil3d_image_view_base_sptr get_view () const
virtual bool view_fits (const vil3d_image_view_base &im, unsigned i0, unsigned j0, unsigned k0)
bool vil3d_copy_deep (const vil3d_image_resource_sptr &src, vil3d_image_resource_sptr &dest)
vil3d_image_resource_sptr vil3d_crop (const vil3d_image_resource_sptr &src, unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk)
vil3d_image_resource_sptr vil3d_new_image_resource (unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format)
vil3d_image_resource_sptr vil3d_new_image_resource (const char *filename, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format, char const *file_format=0)
bool vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename, char const *file_format)
bool vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename)

Private Member Functions

 vimt3d_vil3d_v3i_image (vcl_auto_ptr< vcl_fstream > im)
 Private constructor, use vil3d_load instead.
 vimt3d_vil3d_v3i_image (vcl_auto_ptr< vcl_fstream > file, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format)
 Private constructor, use vil3d_save instead.
bool skip_b_read_vil_memory_chunk (vsl_b_istream &is, unsigned sizeof_T) const
 Skip the reading of a vil_memory_chunk.
void load_full_image () const
 Load full image on demand.

Private Attributes

vcl_fstream * file_
 Pointer to open image file.
vimt3d_image_3dim_
 Image cache.
bool dirty_
 If true, write image file on exit.
header_t header_
 Storage for header information when the whole image has not yet been loaded.

Friends

class vimt3d_vil3d_v3i_format

Detailed Description

Definition at line 76 of file vimt3d_vil3d_v3i.h.


Constructor & Destructor Documentation

vimt3d_vil3d_v3i_image::vimt3d_vil3d_v3i_image ( vcl_auto_ptr< vcl_fstream >  file) [private]

Private constructor, use vil3d_load instead.

This object takes ownership of the image.

This object takes ownership of the file, for reading.

Definition at line 227 of file vimt3d_vil3d_v3i.cxx.

vimt3d_vil3d_v3i_image::vimt3d_vil3d_v3i_image ( vcl_auto_ptr< vcl_fstream >  file,
unsigned  ni,
unsigned  nj,
unsigned  nk,
unsigned  nplanes,
vil_pixel_format  format 
) [private]

Private constructor, use vil3d_save instead.

This object takes ownership of the file, for writing.

Definition at line 427 of file vimt3d_vil3d_v3i.cxx.

vimt3d_vil3d_v3i_image::~vimt3d_vil3d_v3i_image ( ) [virtual]

Definition at line 460 of file vimt3d_vil3d_v3i.cxx.


Member Function Documentation

virtual char const* vimt3d_vil3d_v3i_image::file_format ( ) const [inline, virtual]

Return a string describing the file format.

Only file images have a format, others return 0

Reimplemented from vil3d_image_resource.

Definition at line 173 of file vimt3d_vil3d_v3i.h.

vil3d_image_view_base_sptr vimt3d_vil3d_v3i_image::get_copy_view ( unsigned  i0,
unsigned  ni,
unsigned  j0,
unsigned  nj,
unsigned  k0,
unsigned  nk 
) const [virtual]

Create a read/write view of a copy of this data.

This function will always return a multi-plane scalar-pixel view of the data.

Returns:
0 if unable to get view of correct size, or if resource is write-only.

Currently not yet implemented.

Returns:
0 if unable to get view of correct size.

Implements vil3d_image_resource.

Definition at line 582 of file vimt3d_vil3d_v3i.cxx.

bool vimt3d_vil3d_v3i_image::get_property ( char const *  label,
void *  property_value = 0 
) const [virtual]

Extra property information.

Get the properties (of the first slice).

This will just return the property of the first slice in the list.

Implements vil3d_image_resource.

Definition at line 517 of file vimt3d_vil3d_v3i.cxx.

vil3d_image_view_base_sptr vimt3d_vil3d_v3i_image::get_view ( unsigned  i0,
unsigned  ni,
unsigned  j0,
unsigned  nj,
unsigned  k0,
unsigned  nk 
) const [virtual]

Create a read/write view of a copy of this data.

This function will always return a multi-plane scalar-pixel view of the data.

Returns:
0 if unable to get view of correct size, or if resource is write-only.
0 if unable to get view of correct size.

Reimplemented from vil3d_image_resource.

Definition at line 624 of file vimt3d_vil3d_v3i.cxx.

void vimt3d_vil3d_v3i_image::load_full_image ( ) const [private]

Load full image on demand.

Definition at line 167 of file vimt3d_vil3d_v3i.cxx.

unsigned vimt3d_vil3d_v3i_image::ni ( void  ) const [virtual]

Dimensions: nplanes x ni x nj x nk.

The number of pixels in each row.

Implements vil3d_image_resource.

Definition at line 490 of file vimt3d_vil3d_v3i.cxx.

unsigned vimt3d_vil3d_v3i_image::nj ( void  ) const [virtual]

Dimensions: nplanes x ni x nj x nk.

The number of pixels in each column.

Implements vil3d_image_resource.

Definition at line 497 of file vimt3d_vil3d_v3i.cxx.

unsigned vimt3d_vil3d_v3i_image::nk ( void  ) const [virtual]

Dimensions: nplanes x ni x nj x nk.

The number of slices per image.

Implements vil3d_image_resource.

Definition at line 504 of file vimt3d_vil3d_v3i.cxx.

unsigned vimt3d_vil3d_v3i_image::nplanes ( void  ) const [virtual]

Dimensions: nplanes x ni x nj x nk.

This concept is treated as a synonym to components.

Implements vil3d_image_resource.

Definition at line 483 of file vimt3d_vil3d_v3i.cxx.

enum vil_pixel_format vimt3d_vil3d_v3i_image::pixel_format ( void  ) const [virtual]

Pixel Format.

Implements vil3d_image_resource.

Definition at line 510 of file vimt3d_vil3d_v3i.cxx.

bool vimt3d_vil3d_v3i_image::put_view ( const vil3d_image_view_base im,
unsigned  i0,
unsigned  j0,
unsigned  k0 
) [virtual]

Put the data in this view back into the image source.

Set the contents of the volume.

The view must be of scalar components. Assign your view to a scalar-component view if this is not the case.

Returns:
false if failed, because e.g. resource is read-only, format of view is not correct (if it is a compound pixel type, try assigning it to a multi-plane scalar pixel view.)

Implements vil3d_image_resource.

Definition at line 666 of file vimt3d_vil3d_v3i.cxx.

bool vimt3d_vil3d_v3i_image::set_voxel_size ( float  si,
float  sj,
float  sk 
) [virtual]

Set the size of the each pixel in the i,j,k directions.

Return false if underlying image doesn't store pixel sizes.

Reimplemented from vil3d_image_resource.

Definition at line 547 of file vimt3d_vil3d_v3i.cxx.

void vimt3d_vil3d_v3i_image::set_world2im ( const vimt3d_transform_3d tr)

Set full world to image transform.

Call this before using put_view();

Definition at line 570 of file vimt3d_vil3d_v3i.cxx.

bool vimt3d_vil3d_v3i_image::skip_b_read_vil_memory_chunk ( vsl_b_istream is,
unsigned  sizeof_T 
) const [private]

Skip the reading of a vil_memory_chunk.

Return false if failed, and is error flag on stream if unrecoverable.

Definition at line 87 of file vimt3d_vil3d_v3i.cxx.

const vimt3d_transform_3d & vimt3d_vil3d_v3i_image::world2im ( ) const

Get full world to image transform.

Definition at line 565 of file vimt3d_vil3d_v3i.cxx.


Friends And Related Function Documentation

friend class vimt3d_vil3d_v3i_format [friend]

Definition at line 78 of file vimt3d_vil3d_v3i.h.


Member Data Documentation

If true, write image file on exit.

Definition at line 85 of file vimt3d_vil3d_v3i.h.

vcl_fstream* vimt3d_vil3d_v3i_image::file_ [private]

Pointer to open image file.

Definition at line 80 of file vimt3d_vil3d_v3i.h.

Storage for header information when the whole image has not yet been loaded.

Definition at line 107 of file vimt3d_vil3d_v3i.h.

Image cache.

Currently the whole image is cached im memory. This should be fixed.

Definition at line 83 of file vimt3d_vil3d_v3i.h.


The documentation for this class was generated from the following files: