Skip to first unread message

George Yerou

unread,
Aug 6, 2020, 2:24:23 PM8/6/20
to nat-user
Dear community/ Dr Jefferis,

I would really appreciate some help trying to transfrom on an error I have encountered with xform. For context, my ultimate aim is to go from: jfrc2 (jfrc2010?)--> jrc2018F --> jrc2018unisex so I might do a colourdepth mip mask search. My workflow is as follows:

```
(1) old <- read.nrrd("C:\\Users\\gyero\\Dropbox\\PLP\\split Gal4 lines\\Dorsal\\nrrd\\yourregistrationfolder\\images\\CAND_1_VFB_00015583.nrrd")

(2) reg = h5reg("C:\\Users\\gyero\\Downloads\\h5\\JRC2018F_JFRC2010.h5", swap=FALSE)
(3)  Cand1.jrc2018 = xform(old, reg)

(4) write.nrrd(old, "jrc2018.nrrd")

```
After running (3) I encounter the error:

"Error in xformpoints.h5reg(reg, x, ...) : 
  xformpoints.h5reg only supports 3 dimensions!"

however the nrrd file I have read into R as an array is 3d:

> is(old)
     [1] "array"     "structure" "vector"   
> dim(old)
    [1] 1024  512  218

I previously also encountered an error after (3) saying something along the lines of "array must be numerical", although this seems to have swapped out for the former error.
I alternativley tried reading in a nifti .nii file in place of an nrrd (using the niftyreg package). However, when the resulting file was read out it was only 4 pixels large.

 
Thank you for your help!

Greg Jefferis

unread,
Aug 6, 2020, 2:54:32 PM8/6/20
to George Yerou, nat-user, István Taisz
Dear George,

The error messages are not very clear, but I am afraid that there is currently no support for image volume transformation with the Saalfeld h5reg format.

You must work with the object as a set of point coordinates or use the Saalfeld lab's own tools for volume transformation (https://github.com/saalfeldlab/template-building/wiki/Hdf5-Deformation-fields).

# for the former 
n=flycircuit::fc_read_neurons("VGlut-F-300133")
library(nat.jrcbrains)
n.jrc2018u=xform_brain(n, sample = "FCWB", reference = JRC2018U)

# even steps along the neuron
n.jrc2018u.rs=resample(n.jrc2018u, stepsize = .5)

# MIPs are not in the stanard JRC2018U
JRC2018Umip = templatebrain("JRC2018Umip", dims = c(1210,566,174), voxdims = c(0.519,0.519,1), units = "microns")

im = as.im3d(xyzmatrix(n.jrc2018u.rs), JRC2018Umip)
# set everything over 0 to 255
im[im>0]=255

write.im3d(im, "VGlut-F-300133.nrrd", dtype='byte')
now in Fiji you need to fatten this up a bit

e.g. convolve e.g. with 2-3µm Gaussian
or Dilate 3D 2-4x

To make the MIP, Istvan Taisz in my group advises:
  
It's a bit of a hack, but if you want a quick solution you can use another method in Fiji: Image/Hyperstacks/Temporal-Color code and then pick the MIP's PsychedelicRainBow2 LUT to encode z. In my experience this produces the right result for EM neurons (I haven't tried with LM), and you can use it as a mask for MIP search

All the best,

Greg.

VGlut-F-300133.nrrd
Reply all
Reply to author
Forward
0 new messages