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

#include <vimt3d_vil3d_v3m.h>

Inheritance diagram for vimt3d_vil3d_v3m_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_v3m_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_v3m_image (vcl_auto_ptr< vcl_fstream > im)
 Private constructor, use vil3d_load instead.
 vimt3d_vil3d_v3m_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.
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_v3m_format

Detailed Description

Definition at line 79 of file vimt3d_vil3d_v3m.h.


Constructor & Destructor Documentation

vimt3d_vil3d_v3m_image::vimt3d_vil3d_v3m_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 213 of file vimt3d_vil3d_v3m.cxx.

vimt3d_vil3d_v3m_image::vimt3d_vil3d_v3m_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 264 of file vimt3d_vil3d_v3m.cxx.

vimt3d_vil3d_v3m_image::~vimt3d_vil3d_v3m_image ( ) [virtual]

Definition at line 298 of file vimt3d_vil3d_v3m.cxx.


Member Function Documentation

virtual char const* vimt3d_vil3d_v3m_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 172 of file vimt3d_vil3d_v3m.h.

vil3d_image_view_base_sptr vimt3d_vil3d_v3m_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 485 of file vimt3d_vil3d_v3m.cxx.

bool vimt3d_vil3d_v3m_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 420 of file vimt3d_vil3d_v3m.cxx.

vil3d_image_view_base_sptr vimt3d_vil3d_v3m_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 527 of file vimt3d_vil3d_v3m.cxx.

void vimt3d_vil3d_v3m_image::load_full_image ( ) const [private]

Load full image on demand.

Definition at line 95 of file vimt3d_vil3d_v3m.cxx.

unsigned vimt3d_vil3d_v3m_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 393 of file vimt3d_vil3d_v3m.cxx.

unsigned vimt3d_vil3d_v3m_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 400 of file vimt3d_vil3d_v3m.cxx.

unsigned vimt3d_vil3d_v3m_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 407 of file vimt3d_vil3d_v3m.cxx.

unsigned vimt3d_vil3d_v3m_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 386 of file vimt3d_vil3d_v3m.cxx.

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

Pixel Format.

Implements vil3d_image_resource.

Definition at line 413 of file vimt3d_vil3d_v3m.cxx.

bool vimt3d_vil3d_v3m_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 576 of file vimt3d_vil3d_v3m.cxx.

bool vimt3d_vil3d_v3m_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 450 of file vimt3d_vil3d_v3m.cxx.

void vimt3d_vil3d_v3m_image::set_world2im ( const vimt3d_transform_3d tr)

Set full world to image transform.

Call this before using put_view();

Definition at line 473 of file vimt3d_vil3d_v3m.cxx.

const vimt3d_transform_3d & vimt3d_vil3d_v3m_image::world2im ( ) const

Get full world to image transform.

Definition at line 468 of file vimt3d_vil3d_v3m.cxx.


Friends And Related Function Documentation

friend class vimt3d_vil3d_v3m_format [friend]

Definition at line 81 of file vimt3d_vil3d_v3m.h.


Member Data Documentation

If true, write image file on exit.

Definition at line 88 of file vimt3d_vil3d_v3m.h.

vcl_fstream* vimt3d_vil3d_v3m_image::file_ [private]

Pointer to open image file.

Definition at line 83 of file vimt3d_vil3d_v3m.h.

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

Definition at line 110 of file vimt3d_vil3d_v3m.h.

Image cache.

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

Definition at line 86 of file vimt3d_vil3d_v3m.h.


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