The image class vil3d_image_resource has the method :
bool get_property(char const *label, void *property_value = 0) const;
A false return value means that the underlying image does not understand the given property or that the given data was invalid. A true return value means it does understand the property and has used the supplied data according to the relevant protocol. Passing a null pointer as the second argument can be useful for protocols for manipulating boolean properties (i.e. when there is no data to be passed).
To make this work in practice, it is necessary to avoid name clashes and to make sure everyone agrees on the meaning of the property data. That is the purpose of this file. The set of labels is a namespace in the general sense of the word. We only have one namespace, so try not to clutter it. All property labels described in this file should begin with "vil3d_property_" and that chunk of the namespace is reserved.
An example
float vs[3]; vcl_cout << "Volume of image is "; if (image.get_property(vil3d_property_voxel_size, &voxel_size)) vcl_cout << vs[0]*vs[1]*vs[2]*im.ni()*im.nj()*im.nk() << vcl_endl; else vcl_cout << "unknown\n";
Definition in file vil3d_property.h.
Go to the source code of this file.
1.5.1