OpenChemistry / tomviz

Cross platform, open source application for the processing, visualization, and analysis of 3D tomography data
https://tomviz.org/
BSD 3-Clause "New" or "Revised" License
323 stars 86 forks source link

.npy to .emd batch file converter #2083

Open SBW90 opened 4 years ago

SBW90 commented 4 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]

Trying to use the Tomviz pipeline feature to reconstruct and threshold a series of .npy files which requires converting to .emd . This is also a problem for other file types typically used in Tomviz e.g. tif

Describe the solution you would like Python script which can be launced from python console or built in tool to batch convert file types. Similar to in Digital micrograph for .dm4 to tif etc.

Describe alternatives you have considered Quick GUI conveter program like in QSTEM ?

Additional context I've written a python script which is nearly there but I can't quite work out how to set the image /data/tomogrpay/ImageScalars/Imagescalars and /data/tomography/data to point to the same object reference. I can duplicated but this doubles the file size, or create an empty array of the same size. Would be great to get some pointers on how to rectify this and any improvements that I could make to it.

SBW90 commented 4 years ago

I've solved the file size issue, by hardlinking the /data/tomography/tomviz_scalars/ImageScalars to /data/tomography/data

ercius commented 4 years ago

@SBW90 If you want to easily work with EMD files in python you can use the ncempy.emd subpackage. It simplifies reading EMD files and writing them as well as lots of other common EM formats.

See the io functionality here and the documentation here.