Re: Making algorithms at least 3D, preferably nD
Hello, I think you must all pay attention to standards if you want to act on nD images. For structured data files there is a library that hab been used for decade and which is very efficient, it's netcdf (http://www.unidata.ucar.edu/software/netcdf/), there is already tools in python to deal with it. This library allows one to deal with data in // which is important when one deals with big datas. The last version is based on hdf wich is the tools used on HPC. If your data are not stored in a standard format, the library ITK has provide a binding called SimpleITK that allows one to read every format ITK konws. It is important to take into account the fact that the operation on pixel depend on the grid spacing, as for exampe the finite difference gradient which is wrong when one chooses a step of one because the file as not been read correctly. As the 3D datas often comes from the measurement X-Ray Tomography, MRI, Echography, it is important to consider the device information. The format dicom as been made in this specific purpose there is a python binding called pydicom. I know that scikit team does'nt want to have to much dependances, but for nD case I think it is important to use existing libraries. Best regards Le vendredi 30 novembre 2012 05:45:49 UTC+1, Juan Nunez-Iglesias a écrit :
Hey Guys,
I mentioned this briefly at SciPy, but I would like to reiterate: a lot of data is 3D images these days, and more and more data is being generated that is multi-channel, 3D+t. Therefore, it would be awesome if scikit-image started making more of an effort to support these. In the best case, the dimension of the underlying array can be abstracted away — see here<https://github.com/jni/ray/blob/develop/ray/morpho.py#L328>for example, the functions juicy_center (which extracts the centre of an array, along all dimensions), surfaces (grabs the "border" arrays along each dimension), hollowed (zeroes-out the centre), and more. Otherwise, writing a 3D function that gracefully degrades to 2D when one of the dimensions is 1 is also possible.
In general, the amount of additional effort to make code 3-, 4- or n- dimensional is relatively low when you write the algorithm initially, relative to refactoring a whole bunch of functions later. I'll try to fiddle with whichever code I need, but in the meantime, what do you think about adding a paragraph or a sentence about this issue in the scikit-image contribute <http://scikit-image.org/docs/dev/contribute.html> section, so that people at least have this in mind when they are thinking of writing something new?
Thanks,
Juan.
Hello all, I'm replying here because the subject is more relevant and the thread is more recent, but I'll quote Emmanuelle from the older thread "Segmentation algorithms". On Friday, June 15, 2012 4:28:07 PM UTC-4, Emmanuelle Gouillart wrote:
I could, however, write a tutorial on how to deal with the processing of 3-D images with numpy/skimage/mayavi...
I would be very interested in such a tutorial. :) Since I'm using skimage for processing mostly 3-D images (from X-ray
tomography), I'm strongly biased towards 3-D support. But in fact, it's
only worth implementing an algorithm for 3-D images if it's fast enough and does not have too high a memory load, since the data are much larger (nobody wants to wait one day for the segmentation of a 1000*1000*1000 image... whereas one minute for a 1000x1000 image might still be decent enough in 2-D).
Do you have thoughts on 3D image cross-correlation? My data are images of shape (512, 1536, 21) so the 2D (x, y) part clearly dominates. Still, there is a this z-component of length 21. I'm not making use of it so far and I wonder if I should, if it's worth the trouble of finding an implementation and the additional computational cost. So far, I'm tracking the motion of features on the 2D (512, 1536) images using normalized cross-correlation (function feature.match_template()). The motion looks mainly planar but, well, I'm not sure how refined I should go about this. Thank you, Marianne
On Fri, Apr 26, 2013 at 9:12 AM, Brickle Macho <bricklemacho@gmail.com> wrote:
I could, however, write a tutorial on how to deal with the processing of 3-D images with numpy/skimage/mayavi...
I would be very interested in such a tutorial. :)
+1
Juan's the right guy for the job! I read his original email again, and while I agree that supporting N-d is important, it still strikes me as a lot harder to implement something in N-d vs 2-D (it's much more than just grabbing the "juicy center", etc.). I think he disagrees, so I look forward to learning how to do it better :) Stéfan
participants (4)
-
Brickle Macho
-
jeff witz
-
Marianne Corvellec
-
Stéfan van der Walt