[Neuroimaging] nibabel save returning NotImplementedError at _to_xml_element

Christopher Markiewicz markiewicz at stanford.edu
Sun Mar 31 10:46:55 EDT 2019


Hi Suzanne,

>From what you say, it's hard to tell exactly what's going on. Are you able to share the code that you used to generate the error? Ideally something that can be copied and pasted into a python prompt, so if you have some real data you don't want to share, you can use numpy to generate random arrays:

import numpy as np
my_array = np.random.random((nrows, ncols))

Best,
Chris
________________________________
From: Neuroimaging <neuroimaging-bounces+markiewicz=stanford.edu at python.org> on behalf of Suzanne Witt <switt4 at uwo.ca>
Sent: Thursday, March 28, 2019 4:08 PM
To: neuroimaging at python.org
Subject: [Neuroimaging] nibabel save returning NotImplementedError at _to_xml_element

Hi,

I apologize if this has already been addressed in a previous message, but I did not find anything searching the archives from the Nibabel website.

I am running python 3.7.0 on a conda installation and recently installed the nibabel package to make use of its gifti class.

I have a python script that builds a gifti image object and fills in all of the meta data, label table, and data array details.  The script is based off of a matlab one that successfully makes use of Guillaume Flandin’s @gifti toolkit.  (Not sure if this is relevant or not, but the gifti image objects contains 30 separate data arrays, one for each of 30 individual subjects.)  I have compared my gifti image object’s structure and details to a similar one I loaded in to python using nibabel, and everything looks similar between the two.

When I go to save my newly created gifti image object out using nibabel.save, I am getting a “NotImplementedError” in relation to _to_xml_element().  I am quite new to python, so I have no idea what the error means (a google search and digging through Stack Overflow didn’t yield much I could make sense of).  Trying to debug opened up xmlutils.py, where the only thing that seemed to be defined for _to_xml_element() was raising this NotImplementedError()...

Any suggestions as to how best to proceed?

I’m really not sure if this error is being thrown by something on my end or something on nibabel’s end, so I am happy to provide more details on my python script if that would help.

Thanks in advance,

suzanne



[cid:67412C66-BB70-409C-BE50-7BADCECDE5F9 at uwo-x-11.wireless.uwo.pri]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20190331/a4b1e70b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 98669 bytes
Desc: PastedGraphic-2.png
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20190331/a4b1e70b/attachment-0001.png>


More information about the Neuroimaging mailing list