[MINC-users] minc2 api question
EJ Nikelski
nikelski at bic.mni.mcgill.ca
Fri Jul 11 09:23:17 EDT 2008
Hi Leila (and List),
Thanks for the response. Given my unfamiliarity with the
minc2 api, I was mainly interested in knowing whether the attributes
behaviour was an intentional design decision or a bug. Given your
response, I gather it's a bug. This problem appears to have fairly
wide-ranging consequences, given that any function that attempts to
access spatial attributes via these accessor functions is going to
fail. For example, "miget_space_name" fails (i.e. it returns the
default "native__" space, even for talairach volumes), since it uses
the miget_attr_xxxx function to search the spatial attributes.
As my current minc2-related work is not super time critical, I'll
wait until the minc2 api modifications hit cvs, at which time I will
be happy to test the full range of attribute-related functions.
Cheers,
-Jim
On Tue, Jul 8, 2008 at 12:26 PM, Leila Baghdadi
<baghdadi at phenogenomics.ca> wrote:
> Ej
>
> I have done some modification to attribute functions. I am not sure if
> that would resolve your situation or not.However, I did not get a chance
> to contribute it to cvs as I am working on some other project.
>
> I will try finding some time soon to do that, however not sure when.
>
> If you want I can send you the code and you can change yours to see if
> that resolves the problem.
>
> Leila
>
> On Tue, 2008-08-07 at 12:02 -0400, EJ Nikelski wrote:
>> Hi List,
>>
>> I had a question concerning the operation of a subset of minc2
>> functions, which I believe I posted a few weeks ago -- although I'm
>> now wondering if the post may have been lost. So, just to be sure
>> that it got out, let me throw it out again (pls forgive the redundancy
>> if the first one did get out).
>>
>>
>> ========== start previous post
>>
>> I've been writing some minc2 code, and have run into a problem
>> when retrieving attributes from a minc2 volume. For example, say that
>> I wanted to get information on attribute "xspace:varid" (just as an
>> example). If I were to start by retrieving the length of the
>> attribute by calling miget_attr_length, I would get a no-find returned
>> since miget_attr_length starts all attribute searches relative to
>> /minc-2.0/info. Any path passed to miget_attr_length is simply
>> appended to /minc-2.0/info. Therefore, call like this :
>>
>> result = miget_attr_length(minc_volume, "/minc-2.0/dimensions/xspace",
>> "varid", &attr_length);
>>
>> ... would result in /minc-2.0/info/minc-2.0/dimensions/xspace being
>> searched for attribute "varid" (and subsequently not found). The code
>> that causes this behaviour can be found in a number of miget_attr_xxx
>> functions, and therefore most other attribute related functions
>> similarly are unable to find requested attributes. Now I know that
>> the API has specialty functions to retrieve all sorts of attributes,
>> however, I had assumed that one should be able to use the
>> miget_attr_xxx functions to retrieve any or all of the attributes --
>> and not just those in /minc-2.0/info/. Is this assumption incorrect?
>>
>> By the way, I modified some of the miget_attr_xxx functions on my
>> system to respect an absolute path when passed (and not prepend
>> /minc-2.0/info/), which worked ... but broke other things (including
>> the minc2 "make check", amongst other things) ... so beware, as some
>> code assumes the current behaviour.
>>
>> Any comments/suggestions on this stuff would be welcome.
>>
>>
>> -Jim
>> _______________________________________________
>> MINC-users at bic.mni.mcgill.ca
>> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www2.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
--
=================================
Jim Nikelski, Ph.D.
Postdoctoral Research Fellow
Bloomfield Centre for Research in Aging
Lady Davis Institute for Medical Research
Sir Mortimer B. Davis - Jewish General Hospital
McGill University
Tel: (514) 340-8222 x 2298
Fax: (514) 340-8295
More information about the MINC-users
mailing list