BIC-MNI / libminc

libminc is the core library and API of the MINC toolkit
Other
19 stars 29 forks source link

BUG: Return proper enumerated value from nc_type_to_minc2_type #14

Closed brianhelba closed 10 years ago

brianhelba commented 10 years ago

The function "nc_type_to_minc2_type" is expected to return a value of type "mitype_t", which is an enumerated type. "mitype_t" does not specific a value equivalent to 0, so returning "MI_ORIGINAL_TYPE" (which is 0) produces a warning.

The "nc_type" of "MI_ORIGINAL_TYPE" is a stand-in for "NC_NAT" (i.e. 'Not A Type" [1]). This semantically best corresponds to the "mitype_t" of "MI_TYPE_UNKNOWN".

[1] http://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2000/msg00059.html

brianhelba commented 10 years ago

An example of the warning: http://open.cdash.org/viewBuildError.php?type=1&buildid=3198660

vfonov commented 10 years ago

Hello,

MI_ORIGINAL_TYPE means that the file input file type should be used , like here: https://github.com/BIC-MNI/libminc/blob/develop/volume_io/Volumes/output_mnc2.c#L285

if the MI_TYPE_UNKNOWN is used, volume io will convert everything to double as here: https://github.com/BIC-MNI/libminc/blob/develop/volume_io/Volumes/volumes.c#L280

brianhelba commented 10 years ago

Vlad,

How do you propose the bug be fixed?

vfonov commented 10 years ago

It is not a bug, it is a warning.

Also, you should realize that minc is supposed to be used outside of ITK with other compilation options (i.e with MINC1 support turned on).