Generate classes with: 
python /home/stephan/Dev/Python/generateDS-2.1a/generateDS.py --subclass-suffix="" -f --super="cff" -o /home/stephan/Dev/PyWorkspace/cfflib/cfflib/cff.py -s /home/stephan/Dev/PyWorkspace/cfflib/cfflib/cfflib.py /home/stephan/Dev/PyWorkspace/cfflib/doc/schema/connectome.xsd

Documentation:
http://www.rexx.com/~dkuhlman/generateDS.html

Load a meta.xml file::

	import cfflib
	a = cfflib.parse('/home/stephan/Dev/PyWorkspace/cfflib/datasets/meta.xml')

Export the file::

	f = open('output.xml', 'w')
	f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
	a.export(f, 0, namespacedef_='xmlns="http://www.connectomics.ch/2010/Connectome/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.connectomics.ch/2010/Connectome/xmlns connectome.xsd"')
	f.close()

Think
-----
     
you do not want to require to load all the files in memory to save the cff, thus
add a special insert_..(modify it?) or add_object(?..) or insert_from_filesystem_without_loading

?? csurf_obj = cfflib.CSurface(....., from_file='/.../my.gii')
    # from_file generate a _src attribute that stores the fs path, to be used for saving
   cfile.connectome_surface.append(csurf_obj)
                   
Convention:
.src -> refering to relative path in fs or zip file (iszip = True)
.tmpsrc -> refering to absolute path in fs or tempfile. a tempfile is created when .content != None.
schema to convert absolute file names to relative: CXXX / unique_name.fileformatending


Use Case
--------

* new_connectome() with metadata
* add nifti file from abspath with metadata and description
* add surface file from abspath with metadata and description
* Nifti1Image object. Add it with metadata and description.


In cfflib
---------
* Complete file Saving
* Implement save for iszip == False
* Check script file format field
* how to save imagestack? save hdf5? save trackvis?
* test for all but network the saving mechanism for loaded

* [METHOD] validate file existence
* [METHOD] validate file type
* [METHOD] adder (=setter?) methods for objects (or just add to a list?)
* [METHOD] remover methods for objects (or just remove from a list?)
* [METHOD] info method about available optional dependencies

* [METHOD] add / remove methods for connectome objects, set parent_cfile, check file name consistency
		   cdat = cdata_from_numpy(...); add_cdata(cdat) -> add_cdata_from_numpy(np.array)

Between datatype mapping
------------------------

link to hdf?
* time series (ts) on nodes only -> directly as hdf tag? n x t
* edges ones e x t
* surface vertices, v x t
* surface faces, v x t
* network to HDF: hdffilename:/group/group/dsetarray[:,0]
