ChristophKirst / ClearMap

ClearMap is a python toolbox for the analysis and registration of volumetric data from cleared tissues.
http://christophkirst.github.io/ClearMap/build/html/index.html
GNU General Public License v3.0
49 stars 40 forks source link

IO.writeData() returns string #5

Closed pforai closed 8 years ago

pforai commented 8 years ago

Hi,

The IO.writeData() function returns a string of the file name that is has written data to. I think I'm hitting an issue in the voxelization code where the tutorial and paper supplemental material use code as this:

vox = voxelize(points, AtlasFile, **voxelizationParameter)
io.writeData('/tmp/foo.tif', vox.astype('int32')) 

Since voxelize itself returns IO.writeData() I hit an exception about the .astype() method of str not being implemented.

ChristophKirst commented 8 years ago

This is expected, the file is already written to the data, change sink parameter to None in order for the voxelization routine to return an array, please look into the documentation for further support.

pforai commented 8 years ago

Hi Christoph, In the docs you write that for debugging one can use an optional non-None voxelization parameter in case of debugging, the issue is that if this is set to None the rest of the tutorial fails with the mentioned exception.

ChristophKirst commented 8 years ago

can you please post the code and indicate where exactly the script fails, thank you!

ChristophKirst commented 8 years ago

ps: the routine takes a second argument dataSize which is either an existing file from which the size of the final voxelixed image is determined or a tuple indicating the dataSize, if None is used the size of the image is determined by the extent of the passed points. To specify writing an image to a file for testing, use the sink argument, i.e. write sink = 'filename';

If this is not resolving the issue please follow my request above.

Thanks

ChristophKirst commented 8 years ago

pps: in case you write out the data with a non-None sink argument, comment out the io.writeData line, and everything should be fine

ChristophKirst commented 8 years ago

i committed an update to the process template script to avoid the errors, please try again if this still fails !