[MINC-development] MINC2 API inconsistent data type

Leila Baghdadi baghdadi at phenogenomics.ca
Tue Dec 11 16:23:41 EST 2012


Hi guys,

Yep, I think Andrew summarized it well.
I wanted to at least change the first two functions in the past but every time got into some ditch regarding compatibility with existing code either mine or someone else's, which grew exponentially!
for instance my vtk MINC2 reader/writer, all of my recon code and alot of other code

I agree that hsize_t is the right way to proceed!

once the change has been made, I can make sure all the code on our end is changed!

Leila

----- Original Message -----
From: Andrew Janke <a.janke at gmail.com>
Sent: Tue, 12/11/2012 3:53pm
To: MINC development discussion & planning <minc-development at bic.mni.mcgill.ca>
Subject: Re: [MINC-development] MINC2 API inconsistent data type

Hi Vlad,

> could somebody explain why
>
> int miget_dimension_size(midimhandle_t dimension, unsigned int *size_ptr);
>
> int miget_dimension_sizes(const midimhandle_t dimensions[], int array_length,
>                                  unsigned int sizes[]);
>
>
> - uses unsigned int for dimension size, while
>
> int miget_real_value_hyperslab(mihandle_t volume,
>                                       mitype_t buffer_data_type,
>                                       const unsigned long start[],
>                                       const unsigned long count[],
>                                       void *buffer);
>
> - uses unsigned long for indexing hyperslabs ? Which makes a difference on 64bit platform.

My initial reaction is: "because it's wrong".

> maybe it's worth to have uniform datatype describing size of the dimensions ?

Indeed.

I'll bet this is a result of history in that the first two functions
existed first and the last was added as part of MINC2 at which point
it was decided that such things should be a long. Mind you long is
very much overkill for dimension sizes/start/count but I imagine it
was done because of the 64bit problem as you have said.


a
_______________________________________________
MINC-development mailing list
MINC-development at bic.mni.mcgill.ca
http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-development


More information about the MINC-development mailing list