#include <vil3d_gipl_format.h>
Public Member Functions | |
vil3d_gipl_image (vil_stream *os, unsigned) | |
vil3d_gipl_image (vil_stream *) | |
vil3d_gipl_image (vil_stream *os, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, enum vil_pixel_format format, float vox_width1=1.0, float vox_width2=1.0, float vox_width3=1.0, char orientation_flag=0, double min_val=0.0, double max_val=0.0, double origin1=0.0, double origin2=0.0, double origin3=0.0, float interslice_gap=0.0) | |
virtual | ~vil3d_gipl_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, float, float) |
Set the size of the each voxel in the i,j,k directions. | |
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 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. | |
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 the data. | |
vil3d_image_view_base_sptr | get_view () const |
Create a read/write view of all the data. | |
virtual bool | view_fits (const vil3d_image_view_base &im, unsigned i0, unsigned j0, unsigned k0) |
Check that a view will fit into the data at the given offset. | |
Private Member Functions | |
bool | read_header (vil_stream *is) |
Read header from given stream if possible. | |
bool | write_header (void) |
Private Attributes | |
vil_smart_ptr< vil_stream > | is_ |
vil_smart_ptr< vil_stream > | os_ |
output stream. | |
unsigned | dim1_ |
image dimensions. | |
unsigned | dim2_ |
unsigned | dim3_ |
unsigned | nplanes_ |
number of planes. | |
float | vox_width1_ |
Physical Voxel dimensions ( in mm ). | |
float | vox_width2_ |
float | vox_width3_ |
enum vil_pixel_format | pixel_format_ |
Expected pixel type. | |
char | orientation_flag_ |
Orientation of the image. | |
double | min_val_ |
Minimum and maximum voxel values in the image. | |
double | max_val_ |
double | origin1_ |
X, Y, Z and T offset. | |
double | origin2_ |
double | origin3_ |
float | interslice_gap_ |
vil_streampos | start_of_data_ |
Related Functions | |
(Note that these are not member functions.) | |
bool | vil3d_copy_deep (const vil3d_image_resource_sptr &src, vil3d_image_resource_sptr &dest) |
Copy src to 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) |
Crop to a region of src. | |
vil3d_image_resource_sptr | vil3d_new_image_resource (unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format) |
Make a new image of given 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) |
Make a new image on disk. | |
bool | vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename, char const *file_format) |
Send vil3d_image_resource to disk. | |
bool | vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename) |
Save vil3d_image_resource to file, deducing format from filename. |
Definition at line 42 of file vil3d_gipl_format.h.
vil3d_gipl_image::vil3d_gipl_image | ( | vil_stream * | os, |
unsigned | |||
) |
vil3d_gipl_image::vil3d_gipl_image | ( | vil_stream * | is | ) |
Definition at line 143 of file vil3d_gipl_format.cxx.
vil3d_gipl_image::vil3d_gipl_image | ( | vil_stream * | os, |
unsigned | ni, | ||
unsigned | nj, | ||
unsigned | nk, | ||
unsigned | nplanes, | ||
enum vil_pixel_format | format, | ||
float | vox_width1 = 1.0 , |
||
float | vox_width2 = 1.0 , |
||
float | vox_width3 = 1.0 , |
||
char | orientation_flag = 0 , |
||
double | min_val = 0.0 , |
||
double | max_val = 0.0 , |
||
double | origin1 = 0.0 , |
||
double | origin2 = 0.0 , |
||
double | origin3 = 0.0 , |
||
float | interslice_gap = 0.0 |
||
) |
Definition at line 354 of file vil3d_gipl_format.cxx.
vil3d_gipl_image::~vil3d_gipl_image | ( | ) | [virtual] |
Definition at line 149 of file vil3d_gipl_format.cxx.
virtual char const* vil3d_gipl_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 150 of file vil3d_gipl_format.h.
vil3d_image_view_base_sptr vil3d_gipl_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.
Get some or all of the volume.
This function will always return a multi-plane scalar-pixel view of the data.
Implements vil3d_image_resource.
Definition at line 232 of file vil3d_gipl_format.cxx.
bool vil3d_gipl_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 330 of file vil3d_gipl_format.cxx.
virtual vil3d_image_view_base_sptr vil3d_image_resource::get_view | ( | unsigned | i0, |
unsigned | ni, | ||
unsigned | j0, | ||
unsigned | nj, | ||
unsigned | k0, | ||
unsigned | nk | ||
) | const [inline, virtual, inherited] |
Create a read/write view of the data.
Modifying this view might modify the actual data. If you want to modify this data in place, call put_view after you done, and it should work efficiently. This function will always return a multi-plane scalar-pixel view of the data.
If you want to fill an existing view (e.g. a window onto some other image), then use
vil3d_reformat(data->get_view(..), window); *
Reimplemented in vil3d_crop_image_resource, and vil3d_memory_image.
Definition at line 63 of file vil3d_image_resource.h.
vil3d_image_view_base_sptr vil3d_image_resource::get_view | ( | ) | const [inline, inherited] |
Create a read/write view of all the data.
Definition at line 69 of file vil3d_image_resource.h.
unsigned vil3d_gipl_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 165 of file vil3d_gipl_format.cxx.
unsigned vil3d_gipl_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 172 of file vil3d_gipl_format.cxx.
unsigned vil3d_gipl_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 179 of file vil3d_gipl_format.cxx.
unsigned vil3d_gipl_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 158 of file vil3d_gipl_format.cxx.
enum vil_pixel_format vil3d_gipl_image::pixel_format | ( | void | ) | const [virtual] |
Pixel Format.
Implements vil3d_image_resource.
Definition at line 185 of file vil3d_gipl_format.cxx.
bool vil3d_gipl_image::put_view | ( | const vil3d_image_view_base & | im, |
unsigned | i0 = 0 , |
||
unsigned | j0 = 0 , |
||
unsigned | k0 = 0 |
||
) | [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.
Implements vil3d_image_resource.
Definition at line 641 of file vil3d_gipl_format.cxx.
bool vil3d_gipl_image::read_header | ( | vil_stream * | is | ) | [private] |
Read header from given stream if possible.
Definition at line 192 of file vil3d_gipl_format.cxx.
bool vil3d_gipl_image::set_voxel_size | ( | float | i, |
float | j, | ||
float | k | ||
) | [virtual] |
Set the size of the each voxel in the i,j,k directions.
You can get the voxel sizes via get_properties().
You can get the voxel sizes via get_properties().
Reimplemented from vil3d_image_resource.
Definition at line 629 of file vil3d_gipl_format.cxx.
virtual bool vil3d_image_resource::view_fits | ( | const vil3d_image_view_base & | im, |
unsigned | i0, | ||
unsigned | j0, | ||
unsigned | k0 | ||
) | [inline, virtual, inherited] |
Check that a view will fit into the data at the given offset.
This includes checking that the pixel type is scalar.
Definition at line 97 of file vil3d_image_resource.h.
bool vil3d_gipl_image::write_header | ( | void | ) | [private] |
Definition at line 420 of file vil3d_gipl_format.cxx.
bool vil3d_copy_deep | ( | const vil3d_image_resource_sptr & | src, |
vil3d_image_resource_sptr & | dest | ||
) | [related] |
Copy src to dest.
This is useful if you want to copy on image into a window on another image. src and dest must have identical sizes, and pixel-types. Returns false if the copy failed. O(size).
Definition at line 25 of file vil3d_copy.cxx.
vil3d_image_resource_sptr vil3d_crop | ( | const vil3d_image_resource_sptr & | src, |
unsigned | i0, | ||
unsigned | ni, | ||
unsigned | j0, | ||
unsigned | nj, | ||
unsigned | k0, | ||
unsigned | nk | ||
) | [related] |
Crop to a region of src.
Definition at line 13 of file vil3d_crop.cxx.
vil3d_image_resource_sptr vil3d_new_image_resource | ( | unsigned | ni, |
unsigned | nj, | ||
unsigned | nk, | ||
unsigned | nplanes, | ||
vil_pixel_format | format | ||
) | [related] |
Make a new image of given format.
Reimplemented in vil3d_memory_image.
Definition at line 23 of file vil3d_new.cxx.
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 |
||
) | [related] |
Make a new image on disk.
Definition at line 31 of file vil3d_new.cxx.
bool vil3d_save_image_resource | ( | const vil3d_image_resource_sptr & | ir, |
char const * | filename, | ||
char const * | file_format | ||
) | [related] |
Send vil3d_image_resource to disk.
Definition at line 97 of file vil3d_save.cxx.
bool vil3d_save_image_resource | ( | const vil3d_image_resource_sptr & | ir, |
char const * | filename | ||
) | [related] |
Save vil3d_image_resource to file, deducing format from filename.
Definition at line 111 of file vil3d_save.cxx.
unsigned vil3d_gipl_image::dim1_ [private] |
image dimensions.
Definition at line 50 of file vil3d_gipl_format.h.
unsigned vil3d_gipl_image::dim2_ [private] |
Definition at line 50 of file vil3d_gipl_format.h.
unsigned vil3d_gipl_image::dim3_ [private] |
Definition at line 50 of file vil3d_gipl_format.h.
float vil3d_gipl_image::interslice_gap_ [private] |
Definition at line 73 of file vil3d_gipl_format.h.
vil_smart_ptr<vil_stream> vil3d_gipl_image::is_ [private] |
Definition at line 44 of file vil3d_gipl_format.h.
double vil3d_gipl_image::max_val_ [private] |
Definition at line 68 of file vil3d_gipl_format.h.
double vil3d_gipl_image::min_val_ [private] |
Minimum and maximum voxel values in the image.
Definition at line 68 of file vil3d_gipl_format.h.
unsigned vil3d_gipl_image::nplanes_ [private] |
number of planes.
Definition at line 53 of file vil3d_gipl_format.h.
char vil3d_gipl_image::orientation_flag_ [private] |
Orientation of the image.
Definition at line 65 of file vil3d_gipl_format.h.
double vil3d_gipl_image::origin1_ [private] |
X, Y, Z and T offset.
Definition at line 71 of file vil3d_gipl_format.h.
double vil3d_gipl_image::origin2_ [private] |
Definition at line 71 of file vil3d_gipl_format.h.
double vil3d_gipl_image::origin3_ [private] |
Definition at line 71 of file vil3d_gipl_format.h.
vil_smart_ptr<vil_stream> vil3d_gipl_image::os_ [private] |
output stream.
Definition at line 47 of file vil3d_gipl_format.h.
enum vil_pixel_format vil3d_gipl_image::pixel_format_ [private] |
Expected pixel type.
Definition at line 62 of file vil3d_gipl_format.h.
Definition at line 75 of file vil3d_gipl_format.h.
float vil3d_gipl_image::vox_width1_ [private] |
Physical Voxel dimensions ( in mm ).
Definition at line 56 of file vil3d_gipl_format.h.
float vil3d_gipl_image::vox_width2_ [private] |
Definition at line 56 of file vil3d_gipl_format.h.
float vil3d_gipl_image::vox_width3_ [private] |
Definition at line 56 of file vil3d_gipl_format.h.