I’ve started using Julia for processing microscopy data very recently (switching over from Python). My data tend to be 3D in space (meaning vertical stacks of images) and anisotropic (resolution in z is lower than in xy, due to, among other things, sampling). In Python, I make these stacks isotropic using scipy’s affine_transform function (scipy.ndimage.affine_transform — SciPy v1.12.0 Manual); if one knows the necessary shape of the image after interpolation (i.e., with isotropic coordinates), then this can be applied straightforwardly. I have not been able to find a similar functionality in Julia. Does anyone have any suggestions? Maybe something similar is already implemented? I couldn’t find anything similar in the Images packages. Thanks!
Perhaps you want to visualize a 3D grid with well-defined spacing. Check the GDSJL book for more info on how to create grids and visualize properties over it with Makie.jl:
A convenient solution is the imresize function in the ImageTransformations package; it can perform the necessary upsampling along z given the aspect ratio of xy to z.
You might also want to look into WarpedView. Instead of upsampling the entire volume eagerly, you just upsample on demand. This may be useful if you are dealing with large images with limited memory.
Just for reference, how large are your image stacks? I’m just trying to understand the scale of the problem.
thanks for the suggestion! That indeed looks interesting. I’ll have to think about whether memory allocation is necessary for all the downstream analyses after making the voxels isotropic. The images aren’t that massive (at least compared to some other datasets I’ve seen) – at the most the dimensions would be something like 500x500x100 (anisotropic) voxels per image. But the data are also coming from a timelapse of up to 100 frames, so memory can occasionally be an issue.
Also I wanted to point out that we do have a forum section over at image.sc: Topics tagged juliaimages in case you wanted to discuss this in a software agnostic fashion. I deal with problem a fairly frequently since I work with many people who with ImageJ and FIJI.