From jonathan.taylor at stanford.edu Wed Mar 22 02:56:37 2006 From: jonathan.taylor at stanford.edu (Jonathan Taylor) Date: Tue, 21 Mar 2006 23:56:37 -0800 Subject: [MINC-development] swig wrappers for minc2 Message-ID: <44210335.8070801@stanford.edu> hi, i don't know how much interest there is in this (i am interested at least), but i used swig to generate python wrappers for minc2. they compile (and import) fine, but i have nothing to test them with. in theory, the swig file could be used to generate wrappers for other languages.... attached is the minc2.i i used, and here are the commands i used to build the python module.... from the minc-2.0.05 main directory: make distclean ./configure --prefix=/home/jtaylo/tmp make make install cd libsrc2 swig -python minc2.i gcc -c *.c -I/usr/include/python2.4 gcc -shared *.o -L/home/jtaylo/tmp/lib -lminc2 -lhdf5 -lnetcdf -o _minc2.so python -c "import minc2" got a few warnings: hyper.c: In function 'mirw_hyperslab_raw': hyper.c:420: warning: pointer targets in passing argument 3 of 'H5Sselect_hyperslab' differ in signedness m2util.c: In function 'miinit': m2util.c:938: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c:941: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c: In function 'miinit_enum': m2util.c:979: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c:981: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c:983: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c:985: warning: passing argument 5 of 'H5Tregister' from incompatible pointer type m2util.c: In function 'minc_update_thumbnail': m2util.c:1343: warning: pointer targets in passing argument 3 of 'H5Sselect_hyperslab' differ in signedness m2util.c:1361: warning: pointer targets in passing argument 3 of 'H5Sselect_hyperslab' differ in signedness m2util.c:1372: warning: passing argument 4 of 'H5Sselect_elements' from incompatible pointer type slice.c: In function 'mirw_slice_minmax': slice.c:80: warning: passing argument 4 of 'H5Sselect_elements' from incompatible pointer type best, jonathan -- ------------------------------------------------------------------------ I'm part of the Team in Training: please support our efforts for the Leukemia and Lymphoma Society! http://www.active.com/donate/tntsvmb/tntsvmbJTaylor GO TEAM !!! ------------------------------------------------------------------------ Jonathan Taylor Tel: 650.723.9230 Dept. of Statistics Fax: 650.725.8977 Sequoia Hall, 137 www-stat.stanford.edu/~jtaylo 390 Serra Mall Stanford, CA 94305 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: minc2.i Url: http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20060322/88aa2e36/minc2.ksh From baghdadi at sickkids.ca Wed Mar 22 10:42:28 2006 From: baghdadi at sickkids.ca (Leila Baghdadi) Date: Wed, 22 Mar 2006 10:42:28 -0500 Subject: [MINC-development] swig wrappers for minc2 In-Reply-To: <44210335.8070801@stanford.edu> References: <44210335.8070801@stanford.edu> Message-ID: <1143042148.24657.3.camel@localhost.localdomain> Hello Jonathan, Thanks very much for doing this, I am sure there is plenty of interest. I will check your code see if I use it with minc2.0 images. will let you know Leila On Tue, 2006-21-03 at 23:56 -0800, Jonathan Taylor wrote: > hi, > > i don't know how much interest there is in this (i am interested at > least), but i used swig to generate > python wrappers for minc2. they compile (and import) fine, but i have > nothing to test them with. > > in theory, the swig file could be used to generate wrappers for other > languages.... > > attached is the minc2.i i used, and here are the commands i used to > build the python module.... from the > minc-2.0.05 main directory: > > make distclean > ./configure --prefix=/home/jtaylo/tmp > make > make install > cd libsrc2 > swig -python minc2.i > gcc -c *.c -I/usr/include/python2.4 > gcc -shared *.o -L/home/jtaylo/tmp/lib -lminc2 -lhdf5 -lnetcdf -o > _minc2.so > python -c "import minc2" > > got a few warnings: > hyper.c: In function 'mirw_hyperslab_raw': > hyper.c:420: warning: pointer targets in passing argument 3 of > 'H5Sselect_hyperslab' differ in signedness > m2util.c: In function 'miinit': > m2util.c:938: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c:941: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c: In function 'miinit_enum': > m2util.c:979: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c:981: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c:983: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c:985: warning: passing argument 5 of 'H5Tregister' from > incompatible pointer type > m2util.c: In function 'minc_update_thumbnail': > m2util.c:1343: warning: pointer targets in passing argument 3 of > 'H5Sselect_hyperslab' differ in signedness > m2util.c:1361: warning: pointer targets in passing argument 3 of > 'H5Sselect_hyperslab' differ in signedness > m2util.c:1372: warning: passing argument 4 of 'H5Sselect_elements' from > incompatible pointer type > slice.c: In function 'mirw_slice_minmax': > slice.c:80: warning: passing argument 4 of 'H5Sselect_elements' from > incompatible pointer type > > best, > > jonathan > > > plain text document attachment (minc2.i) > %module minc2 > %{ > #include "minc2.h" > %} > > /* ATTRIBUTE/GROUP FUNCTIONS */ > > extern int micreate_group(mihandle_t vol, const char *path, const char *name); > extern int midelete_attr(mihandle_t vol, const char *path, const char *name); > extern int midelete_group(mihandle_t vol, const char *path, const char *name); > extern int miget_attr_length(mihandle_t vol, const char *path, > const char *name, int *length); > extern int miget_attr_type(mihandle_t vol, const char *path, const char *name, > mitype_t *data_type); > extern int miget_attr_values(mihandle_t vol, mitype_t data_type, > const char *path, const char *name, > int length, void *values); > extern int miset_attr_values(mihandle_t vol, mitype_t data_type, > const char *path, const char *name, int length, > const void *values); > > /* FREE FUNCTIONS */ > extern int mifree_name(char *name_ptr); > extern int mifree_names(char **name_pptr); > > /* DATA TYPE/SPACE FUNCTIONS */ > extern int miget_data_class(mihandle_t vol, miclass_t *volume_class); > extern int miget_data_type(mihandle_t vol, mitype_t *volume_data_type); > extern int miget_data_type_size(mihandle_t vol, misize_t *voxel_size); > extern int miget_space_name(mihandle_t vol, char **name); > extern int miset_space_name(mihandle_t vol, const char *name); > > /* DIMENSION FUNCTIONS */ > extern int miget_volume_from_dimension(midimhandle_t dimension, mihandle_t *volume); > extern int micopy_dimension(midimhandle_t dim_ptr, midimhandle_t *new_dim_ptr); > extern int micreate_dimension(const char *name, midimclass_t dimclass, midimattr_t attr, > unsigned long length, midimhandle_t *new_dim_ptr); > extern int mifree_dimension_handle(midimhandle_t dim_ptr); > extern int miget_volume_dimensions(mihandle_t volume, midimclass_t dimclass, midimattr_t attr, > miorder_t order, int array_length, > midimhandle_t dimensions[]); > extern int miset_apparent_dimension_order(mihandle_t volume, int array_length, midimhandle_t dimensions[]); > extern int miset_apparent_dimension_order_by_name(mihandle_t volume, int array_length, char **names); > extern int miset_apparent_record_dimension_flag(mihandle_t volume, int record_flag); > extern int miget_dimension_apparent_voxel_order(midimhandle_t dimension, miflipping_t *file_order, > miflipping_t *sign); > extern int miset_dimension_apparent_voxel_order(midimhandle_t dimension, miflipping_t flipping_order); > extern int miget_dimension_class(midimhandle_t dimension, midimclass_t *dimclass); > extern int miset_dimension_class(midimhandle_t dimension, midimclass_t dimclass); > extern int miget_dimension_cosines(midimhandle_t dimension, > double direction_cosines[3]); > extern int miset_dimension_cosines(midimhandle_t dimension, > const double direction_cosines[3]); > extern int miset_dimension_description(midimhandle_t dimension, const char *comments); > extern int miget_dimension_description(midimhandle_t dimension, char **comments_ptr); > extern int miget_dimension_name(midimhandle_t dimension, char **name_ptr); > extern int miset_dimension_name(midimhandle_t dimension, const char *name); > extern int miget_dimension_offsets(midimhandle_t dimension, unsigned long array_length, > unsigned long start_position, double offsets[]); > extern int miset_dimension_offsets(midimhandle_t dimension, unsigned long array_length, > unsigned long start_position, const double offsets[]); > extern int miget_dimension_sampling_flag(midimhandle_t dimension, BOOLEAN *sampling_flag); > extern int miset_dimension_sampling_flag(midimhandle_t dimension, BOOLEAN sampling_flag); > extern int miget_dimension_separation(midimhandle_t dimension, mivoxel_order_t voxel_order, > double *separation_ptr); > extern int miset_dimension_separation(midimhandle_t dimension, double separation); > extern int miget_dimension_separations(const midimhandle_t dimensions[], > mivoxel_order_t voxel_order, int array_length, > double separations[]); > extern int miset_dimension_separations(const midimhandle_t dimensions[], int array_length, > const double separations[]); > extern int miget_dimension_size(midimhandle_t dimension, unsigned long *size_ptr); > extern int miset_dimension_size(midimhandle_t dimension, unsigned long size); > extern int miget_dimension_sizes(const midimhandle_t dimensions[], int array_length, > unsigned long sizes[]); > extern int miget_dimension_start(midimhandle_t dimension, mivoxel_order_t voxel_order, > double *start_ptr); > extern int miset_dimension_start(midimhandle_t dimension, double start_ptr); > extern int miget_dimension_starts(const midimhandle_t dimensions[], mivoxel_order_t voxel_order, > int array_length, double starts[]); > extern int miset_dimension_starts(const midimhandle_t dimensions[], int array_length, > const double starts[]); > extern int miget_dimension_units(midimhandle_t dimension, char **units_ptr); > extern int miset_dimension_units(midimhandle_t dimension, const char *units); > extern int miget_dimension_width(midimhandle_t dimension, double *width_ptr); > extern int miset_dimension_width(midimhandle_t dimension, double width_ptr); > extern int miget_dimension_widths(midimhandle_t dimension, mivoxel_order_t voxel_order, > unsigned long array_length, unsigned long start_position, > double widths[]); > extern int miset_dimension_widths(midimhandle_t dimension, unsigned long array_length, > unsigned long start_position, const double widths[]); > > > /* VOLUME FUNCTIONS */ > extern int micreate_volume(const char *filename, int number_of_dimensions, > midimhandle_t dimensions[], > mitype_t volume_type, > miclass_t volume_class, > mivolumeprops_t create_props, > mihandle_t *volume); > extern int micreate_volume_image(mihandle_t volume); > extern int miget_volume_dimension_count(mihandle_t volume, midimclass_t dimclass, > midimattr_t attr, int *number_of_dimensions); > extern int miget_volume_voxel_count(mihandle_t volume, int *number_of_voxels); > extern int miopen_volume(const char *filename, int mode, mihandle_t *volume); > extern int miclose_volume(mihandle_t volume); > > extern int miget_slice_scaling_flag(mihandle_t volume, > BOOLEAN *slice_scaling_flag); > extern int miset_slice_scaling_flag(mihandle_t volume, > BOOLEAN slice_scaling_flag); > > /* VOLUME PROPERTIES FUNCTIONS */ > extern int minew_volume_props(mivolumeprops_t *props); > extern int mifree_volume_props(mivolumeprops_t props); > extern int miget_volume_props(mihandle_t vol, mivolumeprops_t *props); > extern int miset_props_multi_resolution(mivolumeprops_t props, BOOLEAN enable_flag, > int depth); > extern int miget_props_multi_resolution(mivolumeprops_t props, BOOLEAN *enable_flag, > int *depth); > extern int miselect_resolution(mihandle_t volume, int depth); > extern int miflush_from_resolution(mihandle_t volume, int depth); > extern int miset_props_compression_type(mivolumeprops_t props, micompression_t compression_type); > extern int miget_props_compression_type(mivolumeprops_t props, micompression_t *compression_type); > extern int miset_props_zlib_compression(mivolumeprops_t props, int zlib_level); > extern int miget_props_zlib_compression(mivolumeprops_t props, int *zlib_level); > extern int miset_props_blocking(mivolumeprops_t props, int edge_count, const int *edge_lengths); > extern int miget_props_blocking(mivolumeprops_t props, int *edge_count, int *edge_lengths, > int max_lengths); > extern int miset_props_record(mivolumeprops_t props, long record_length, char *record_name); > extern int miset_props_template(mivolumeprops_t props, int template_flag); > > /* SLICE/VOLUME SCALE FUNCTIONS */ > extern int miget_slice_max(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double *slice_max); > extern int miset_slice_max(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double slice_max); > extern int miget_slice_min(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double *slice_min); > extern int miset_slice_min(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double slice_min); > extern int miget_slice_range(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double *slice_max, > double *slice_min); > extern int miset_slice_range(mihandle_t volume, > const unsigned long start_positions[], > int array_length, double slice_max, > double slice_min); > extern int miget_volume_max(mihandle_t volume, double *slice_max); > extern int miset_volume_max(mihandle_t volume, double slice_max); > extern int miget_volume_min(mihandle_t volume, double *slice_min); > extern int miset_volume_min(mihandle_t volume, double slice_min); > extern int miget_volume_range(mihandle_t volume, double *slice_max, > double *slice_min); > extern int miset_volume_range(mihandle_t volume, double slice_max, > double slice_min); > /* HYPERSLAB FUNCTIONS */ > > extern int miget_real_value_hyperslab(mihandle_t volume, > mitype_t buffer_data_type, > const unsigned long start[], > const unsigned long count[], > void *buffer); > > extern int miset_real_value_hyperslab(mihandle_t volume, > mitype_t buffer_data_type, > const unsigned long start[], > const unsigned long count[], > const void *buffer); > > extern int miget_voxel_value_hyperslab(mihandle_t volume, > mitype_t buffer_data_type, > const unsigned long start[], > const unsigned long count[], > void *buffer); > > extern int miset_voxel_value_hyperslab(mihandle_t volume, > mitype_t buffer_data_type, > const unsigned long start[], > const unsigned long count[], > const void *buffer); > > extern int miget_hyperslab_normalized(mihandle_t volume, > mitype_t buffer_data_type, > const unsigned long start[], > const unsigned long count[], > double min, > double max, > void *buffer); > > /* CONVERT FUNCTIONS */ > extern int miconvert_real_to_voxel(mihandle_t volume, > const unsigned long coords[], > int ncoords, > double real_value, > double *voxel_value_ptr); > > extern int miconvert_voxel_to_real(mihandle_t volume, > const unsigned long coords[], > int ncoords, > double voxel_value, > double *real_value_ptr); > > extern int miconvert_3D_voxel_to_world(mihandle_t volume, > const double voxel[], > double world[]); > > extern int miconvert_3D_world_to_voxel(mihandle_t volume, > const double world[], > double voxel[]); > > extern int miget_real_value(mihandle_t volume, > const unsigned long coords[], > int ndims, > double *value_ptr); > > extern int miset_real_value(mihandle_t volume, > const unsigned long coords[], > int ndims, > double value); > extern int miget_voxel_value(mihandle_t volume, > const unsigned long coords[], > int ndims, > double *voxel_ptr); > > extern int miset_voxel_value(mihandle_t volume, > const unsigned long coords[], > int ndims, > double voxel); > > extern int miget_volume_real_range(mihandle_t volume, double real_range[2]); > > /* VALID functions */ > extern int miget_volume_valid_max(mihandle_t volume, double *valid_max); > extern int miset_volume_valid_max(mihandle_t volume, double valid_max); > extern int miget_volume_valid_min(mihandle_t volume, double *valid_min); > extern int miset_volume_valid_min(mihandle_t volume, double valid_min); > extern int miget_volume_valid_range(mihandle_t volume, > double *valid_max, double *valid_min); > extern int miset_volume_valid_range(mihandle_t volume, > double valid_max, double valid_min); > > /* RECORD functions */ > extern int miget_record_name(mihandle_t volume, char **name); > extern int miget_record_length(mihandle_t volume, int *length); > extern int miget_record_field_name(mihandle_t volume, int index, char **name); > extern int miset_record_field_name(mihandle_t volume, int index, > const char *name); > > /* LABEL functions */ > extern int midefine_label(mihandle_t volume, int value, const char *name); > extern int miget_label_name(mihandle_t volume, int value, char **name); > extern int miget_label_value(mihandle_t volume, const char *name, int *value); > > _______________________________________________ > MINC-development mailing list > MINC-development at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development From jonathan.taylor at stanford.edu Wed Mar 22 12:53:44 2006 From: jonathan.taylor at stanford.edu (Jonathan Taylor) Date: Wed, 22 Mar 2006 09:53:44 -0800 Subject: [MINC-development] swig wrappers for minc2 In-Reply-To: <1143042148.24657.3.camel@localhost.localdomain> References: <44210335.8070801@stanford.edu> <1143042148.24657.3.camel@localhost.localdomain> Message-ID: <44218F28.4000201@stanford.edu> hello leila, the wrapper is probably not very functional -- it was my first attempt at swig. now that i've read a little more swig documentation i might do a better job. i would like to try testing it out on some minc2.0 images, too. as i was a student at mcgill, i actually still have an MNI account. can you point me to a few example files? -- jonathan Leila Baghdadi wrote: >Hello Jonathan, > >Thanks very much for doing this, I am sure there is plenty of interest. > >I will check your code see if I use it with minc2.0 images. > >will let you know > >Leila > >On Tue, 2006-21-03 at 23:56 -0800, Jonathan Taylor wrote: > > >>hi, >> >>i don't know how much interest there is in this (i am interested at >>least), but i used swig to generate >>python wrappers for minc2. they compile (and import) fine, but i have >>nothing to test them with. >> >>in theory, the swig file could be used to generate wrappers for other >>languages.... >> >>attached is the minc2.i i used, and here are the commands i used to >>build the python module.... from the >>minc-2.0.05 main directory: >> >>make distclean >>./configure --prefix=/home/jtaylo/tmp >> make >>make install >>cd libsrc2 >> swig -python minc2.i >> gcc -c *.c -I/usr/include/python2.4 >> gcc -shared *.o -L/home/jtaylo/tmp/lib -lminc2 -lhdf5 -lnetcdf -o >>_minc2.so >> python -c "import minc2" >> >>got a few warnings: >>hyper.c: In function 'mirw_hyperslab_raw': >>hyper.c:420: warning: pointer targets in passing argument 3 of >>'H5Sselect_hyperslab' differ in signedness >>m2util.c: In function 'miinit': >>m2util.c:938: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c:941: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c: In function 'miinit_enum': >>m2util.c:979: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c:981: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c:983: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c:985: warning: passing argument 5 of 'H5Tregister' from >>incompatible pointer type >>m2util.c: In function 'minc_update_thumbnail': >>m2util.c:1343: warning: pointer targets in passing argument 3 of >>'H5Sselect_hyperslab' differ in signedness >>m2util.c:1361: warning: pointer targets in passing argument 3 of >>'H5Sselect_hyperslab' differ in signedness >>m2util.c:1372: warning: passing argument 4 of 'H5Sselect_elements' from >>incompatible pointer type >>slice.c: In function 'mirw_slice_minmax': >>slice.c:80: warning: passing argument 4 of 'H5Sselect_elements' from >>incompatible pointer type >> >>best, >> >>jonathan >> >> >>plain text document attachment (minc2.i) >>%module minc2 >>%{ >>#include "minc2.h" >>%} >> >>/* ATTRIBUTE/GROUP FUNCTIONS */ >> >>extern int micreate_group(mihandle_t vol, const char *path, const char *name); >>extern int midelete_attr(mihandle_t vol, const char *path, const char *name); >>extern int midelete_group(mihandle_t vol, const char *path, const char *name); >>extern int miget_attr_length(mihandle_t vol, const char *path, >> const char *name, int *length); >>extern int miget_attr_type(mihandle_t vol, const char *path, const char *name, >> mitype_t *data_type); >>extern int miget_attr_values(mihandle_t vol, mitype_t data_type, >> const char *path, const char *name, >> int length, void *values); >>extern int miset_attr_values(mihandle_t vol, mitype_t data_type, >> const char *path, const char *name, int length, >> const void *values); >> >>/* FREE FUNCTIONS */ >>extern int mifree_name(char *name_ptr); >>extern int mifree_names(char **name_pptr); >> >>/* DATA TYPE/SPACE FUNCTIONS */ >>extern int miget_data_class(mihandle_t vol, miclass_t *volume_class); >>extern int miget_data_type(mihandle_t vol, mitype_t *volume_data_type); >>extern int miget_data_type_size(mihandle_t vol, misize_t *voxel_size); >>extern int miget_space_name(mihandle_t vol, char **name); >>extern int miset_space_name(mihandle_t vol, const char *name); >> >>/* DIMENSION FUNCTIONS */ >>extern int miget_volume_from_dimension(midimhandle_t dimension, mihandle_t *volume); >>extern int micopy_dimension(midimhandle_t dim_ptr, midimhandle_t *new_dim_ptr); >>extern int micreate_dimension(const char *name, midimclass_t dimclass, midimattr_t attr, >> unsigned long length, midimhandle_t *new_dim_ptr); >>extern int mifree_dimension_handle(midimhandle_t dim_ptr); >>extern int miget_volume_dimensions(mihandle_t volume, midimclass_t dimclass, midimattr_t attr, >> miorder_t order, int array_length, >> midimhandle_t dimensions[]); >>extern int miset_apparent_dimension_order(mihandle_t volume, int array_length, midimhandle_t dimensions[]); >>extern int miset_apparent_dimension_order_by_name(mihandle_t volume, int array_length, char **names); >>extern int miset_apparent_record_dimension_flag(mihandle_t volume, int record_flag); >>extern int miget_dimension_apparent_voxel_order(midimhandle_t dimension, miflipping_t *file_order, >> miflipping_t *sign); >>extern int miset_dimension_apparent_voxel_order(midimhandle_t dimension, miflipping_t flipping_order); >>extern int miget_dimension_class(midimhandle_t dimension, midimclass_t *dimclass); >>extern int miset_dimension_class(midimhandle_t dimension, midimclass_t dimclass); >>extern int miget_dimension_cosines(midimhandle_t dimension, >> double direction_cosines[3]); >>extern int miset_dimension_cosines(midimhandle_t dimension, >> const double direction_cosines[3]); >>extern int miset_dimension_description(midimhandle_t dimension, const char *comments); >>extern int miget_dimension_description(midimhandle_t dimension, char **comments_ptr); >>extern int miget_dimension_name(midimhandle_t dimension, char **name_ptr); >>extern int miset_dimension_name(midimhandle_t dimension, const char *name); >>extern int miget_dimension_offsets(midimhandle_t dimension, unsigned long array_length, >> unsigned long start_position, double offsets[]); >>extern int miset_dimension_offsets(midimhandle_t dimension, unsigned long array_length, >> unsigned long start_position, const double offsets[]); >>extern int miget_dimension_sampling_flag(midimhandle_t dimension, BOOLEAN *sampling_flag); >>extern int miset_dimension_sampling_flag(midimhandle_t dimension, BOOLEAN sampling_flag); >>extern int miget_dimension_separation(midimhandle_t dimension, mivoxel_order_t voxel_order, >> double *separation_ptr); >>extern int miset_dimension_separation(midimhandle_t dimension, double separation); >>extern int miget_dimension_separations(const midimhandle_t dimensions[], >> mivoxel_order_t voxel_order, int array_length, >> double separations[]); >>extern int miset_dimension_separations(const midimhandle_t dimensions[], int array_length, >> const double separations[]); >>extern int miget_dimension_size(midimhandle_t dimension, unsigned long *size_ptr); >>extern int miset_dimension_size(midimhandle_t dimension, unsigned long size); >>extern int miget_dimension_sizes(const midimhandle_t dimensions[], int array_length, >> unsigned long sizes[]); >>extern int miget_dimension_start(midimhandle_t dimension, mivoxel_order_t voxel_order, >> double *start_ptr); >>extern int miset_dimension_start(midimhandle_t dimension, double start_ptr); >>extern int miget_dimension_starts(const midimhandle_t dimensions[], mivoxel_order_t voxel_order, >> int array_length, double starts[]); >>extern int miset_dimension_starts(const midimhandle_t dimensions[], int array_length, >> const double starts[]); >>extern int miget_dimension_units(midimhandle_t dimension, char **units_ptr); >>extern int miset_dimension_units(midimhandle_t dimension, const char *units); >>extern int miget_dimension_width(midimhandle_t dimension, double *width_ptr); >>extern int miset_dimension_width(midimhandle_t dimension, double width_ptr); >>extern int miget_dimension_widths(midimhandle_t dimension, mivoxel_order_t voxel_order, >> unsigned long array_length, unsigned long start_position, >> double widths[]); >>extern int miset_dimension_widths(midimhandle_t dimension, unsigned long array_length, >> unsigned long start_position, const double widths[]); >> >> >>/* VOLUME FUNCTIONS */ >>extern int micreate_volume(const char *filename, int number_of_dimensions, >> midimhandle_t dimensions[], >> mitype_t volume_type, >> miclass_t volume_class, >> mivolumeprops_t create_props, >> mihandle_t *volume); >>extern int micreate_volume_image(mihandle_t volume); >>extern int miget_volume_dimension_count(mihandle_t volume, midimclass_t dimclass, >> midimattr_t attr, int *number_of_dimensions); >>extern int miget_volume_voxel_count(mihandle_t volume, int *number_of_voxels); >>extern int miopen_volume(const char *filename, int mode, mihandle_t *volume); >>extern int miclose_volume(mihandle_t volume); >> >>extern int miget_slice_scaling_flag(mihandle_t volume, >> BOOLEAN *slice_scaling_flag); >>extern int miset_slice_scaling_flag(mihandle_t volume, >> BOOLEAN slice_scaling_flag); >> >>/* VOLUME PROPERTIES FUNCTIONS */ >>extern int minew_volume_props(mivolumeprops_t *props); >>extern int mifree_volume_props(mivolumeprops_t props); >>extern int miget_volume_props(mihandle_t vol, mivolumeprops_t *props); >>extern int miset_props_multi_resolution(mivolumeprops_t props, BOOLEAN enable_flag, >> int depth); >>extern int miget_props_multi_resolution(mivolumeprops_t props, BOOLEAN *enable_flag, >> int *depth); >>extern int miselect_resolution(mihandle_t volume, int depth); >>extern int miflush_from_resolution(mihandle_t volume, int depth); >>extern int miset_props_compression_type(mivolumeprops_t props, micompression_t compression_type); >>extern int miget_props_compression_type(mivolumeprops_t props, micompression_t *compression_type); >>extern int miset_props_zlib_compression(mivolumeprops_t props, int zlib_level); >>extern int miget_props_zlib_compression(mivolumeprops_t props, int *zlib_level); >>extern int miset_props_blocking(mivolumeprops_t props, int edge_count, const int *edge_lengths); >>extern int miget_props_blocking(mivolumeprops_t props, int *edge_count, int *edge_lengths, >> int max_lengths); >>extern int miset_props_record(mivolumeprops_t props, long record_length, char *record_name); >>extern int miset_props_template(mivolumeprops_t props, int template_flag); >> >>/* SLICE/VOLUME SCALE FUNCTIONS */ >>extern int miget_slice_max(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double *slice_max); >>extern int miset_slice_max(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double slice_max); >>extern int miget_slice_min(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double *slice_min); >>extern int miset_slice_min(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double slice_min); >>extern int miget_slice_range(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double *slice_max, >> double *slice_min); >>extern int miset_slice_range(mihandle_t volume, >> const unsigned long start_positions[], >> int array_length, double slice_max, >> double slice_min); >>extern int miget_volume_max(mihandle_t volume, double *slice_max); >>extern int miset_volume_max(mihandle_t volume, double slice_max); >>extern int miget_volume_min(mihandle_t volume, double *slice_min); >>extern int miset_volume_min(mihandle_t volume, double slice_min); >>extern int miget_volume_range(mihandle_t volume, double *slice_max, >> double *slice_min); >>extern int miset_volume_range(mihandle_t volume, double slice_max, >> double slice_min); >>/* HYPERSLAB FUNCTIONS */ >> >>extern int miget_real_value_hyperslab(mihandle_t volume, >> mitype_t buffer_data_type, >> const unsigned long start[], >> const unsigned long count[], >> void *buffer); >> >>extern int miset_real_value_hyperslab(mihandle_t volume, >> mitype_t buffer_data_type, >> const unsigned long start[], >> const unsigned long count[], >> const void *buffer); >> >>extern int miget_voxel_value_hyperslab(mihandle_t volume, >> mitype_t buffer_data_type, >> const unsigned long start[], >> const unsigned long count[], >> void *buffer); >> >>extern int miset_voxel_value_hyperslab(mihandle_t volume, >> mitype_t buffer_data_type, >> const unsigned long start[], >> const unsigned long count[], >> const void *buffer); >> >>extern int miget_hyperslab_normalized(mihandle_t volume, >> mitype_t buffer_data_type, >> const unsigned long start[], >> const unsigned long count[], >> double min, >> double max, >> void *buffer); >> >>/* CONVERT FUNCTIONS */ >>extern int miconvert_real_to_voxel(mihandle_t volume, >> const unsigned long coords[], >> int ncoords, >> double real_value, >> double *voxel_value_ptr); >> >>extern int miconvert_voxel_to_real(mihandle_t volume, >> const unsigned long coords[], >> int ncoords, >> double voxel_value, >> double *real_value_ptr); >> >>extern int miconvert_3D_voxel_to_world(mihandle_t volume, >> const double voxel[], >> double world[]); >> >>extern int miconvert_3D_world_to_voxel(mihandle_t volume, >> const double world[], >> double voxel[]); >> >>extern int miget_real_value(mihandle_t volume, >> const unsigned long coords[], >> int ndims, >> double *value_ptr); >> >>extern int miset_real_value(mihandle_t volume, >> const unsigned long coords[], >> int ndims, >> double value); >>extern int miget_voxel_value(mihandle_t volume, >> const unsigned long coords[], >> int ndims, >> double *voxel_ptr); >> >>extern int miset_voxel_value(mihandle_t volume, >> const unsigned long coords[], >> int ndims, >> double voxel); >> >>extern int miget_volume_real_range(mihandle_t volume, double real_range[2]); >> >>/* VALID functions */ >>extern int miget_volume_valid_max(mihandle_t volume, double *valid_max); >>extern int miset_volume_valid_max(mihandle_t volume, double valid_max); >>extern int miget_volume_valid_min(mihandle_t volume, double *valid_min); >>extern int miset_volume_valid_min(mihandle_t volume, double valid_min); >>extern int miget_volume_valid_range(mihandle_t volume, >> double *valid_max, double *valid_min); >>extern int miset_volume_valid_range(mihandle_t volume, >> double valid_max, double valid_min); >> >>/* RECORD functions */ >>extern int miget_record_name(mihandle_t volume, char **name); >>extern int miget_record_length(mihandle_t volume, int *length); >>extern int miget_record_field_name(mihandle_t volume, int index, char **name); >>extern int miset_record_field_name(mihandle_t volume, int index, >> const char *name); >> >>/* LABEL functions */ >>extern int midefine_label(mihandle_t volume, int value, const char *name); >>extern int miget_label_name(mihandle_t volume, int value, char **name); >>extern int miget_label_value(mihandle_t volume, const char *name, int *value); >> >>_______________________________________________ >>MINC-development mailing list >>MINC-development at bic.mni.mcgill.ca >>http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development >> >> > >_______________________________________________ >MINC-development mailing list >MINC-development at bic.mni.mcgill.ca >http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-developmen > > -- ------------------------------------------------------------------------ I'm part of the Team in Training: please support our efforts for the Leukemia and Lymphoma Society! http://www.active.com/donate/tntsvmb/tntsvmbJTaylor GO TEAM !!! ------------------------------------------------------------------------ Jonathan Taylor Tel: 650.723.9230 Dept. of Statistics Fax: 650.725.8977 Sequoia Hall, 137 www-stat.stanford.edu/~jtaylo 390 Serra Mall Stanford, CA 94305 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20060322/e77a7d54/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jonathan.taylor.vcf Type: text/x-vcard Size: 329 bytes Desc: not available Url : http://www.bic.mni.mcgill.ca/pipermail/minc-development/attachments/20060322/e77a7d54/jonathan.taylor-0001.vcf From pellegrinis at ninds.nih.gov Tue Mar 28 10:07:39 2006 From: pellegrinis at ninds.nih.gov (Pellegrini, Stefano (NIH/NINDS) [F]) Date: Tue, 28 Mar 2006 10:07:39 -0500 Subject: [MINC-development] tfm_input_sampling Message-ID: Hi everybody, might anybody tell me why when I use mincresample with -transform -tfm_input_sampling I get that in the output file the space:step and space:start attributes (and others, see below) are changed? for example, this is the input regarding 'xspace' double xspace ; xspace:varid = "MINC standard variable" ; xspace:vartype = "dimension____" ; xspace:version = "MINC Version 1.0" ; xspace:comments = "X increases from patient left to right" ; xspace:spacing = "regular__" ; xspace:alignment = "centre" ; xspace:step = 0.9375 ; xspace:start = -115.585746765137 ; xspace:direction_cosines = -1., 0., 0. ; xspace:units = "mm" ; and this is the output: int xspace ; xspace:varid = "MINC standard variable" ; xspace:vartype = "dimension____" ; xspace:version = "MINC Version 1.0" ; xspace:comments = "X increases from patient left to right" ; xspace:spacing = "regular__" ; xspace:alignment = "centre" ; xspace:step = -0.9375 ; xspace:start = 115.585746765137 ; xspace:direction_cosines = 1., -0., -0. ; xspace:units = "mm" ; xspace:spacetype = "native____" ; thank you very much, -stefano From peter.neelin at gmail.com Tue Mar 28 21:32:15 2006 From: peter.neelin at gmail.com (Peter Neelin) Date: Tue, 28 Mar 2006 21:32:15 -0500 Subject: [MINC-development] tfm_input_sampling In-Reply-To: References: Message-ID: On 3/28/06, Pellegrini, Stefano (NIH/NINDS) [F] wrote: > might anybody tell me why when I use mincresample with > -transform -tfm_input_sampling > I get that in the output file the space:step and space:start attributes (and others, see below) are changed? > > double xspace ; > xspace:step = 0.9375 ; > xspace:start = -115.585746765137 ; > xspace:direction_cosines = -1., 0., 0. ; The direction cosines should be in the positive direction. mincresample will correct this on output. From the minc programmer's reference (version 1.4, but unchanged from ancient versions): Note that the dot product of the direction cosine with the corresponding axis ((1,0,0), (0,1,0) or (0,0,1)) should be positive so that the sign of the attribute MIstep contains the orientation information. Note that both step and start are negated. That is because they are distances along the the axis vector - flipping the vector requires negating them. Peter -- Peter Neelin (peter.neelin at gmail.com)