Calculating overlaps with FlyLight image data Re: FlyLight Matlab screen

56 views
Skip to first unread message

Dr Gregory Jefferis

unread,
May 7, 2015, 5:47:02 AM5/7/15
to Oliver Barnstedt, Michael-John Dolan, nat-...@googlegroups.com
Hi Oliver,

Thanks a lot for sharing this and sorry for the delayed response!

We have our own approach to doing this, which is based on the open
source "NeuroAnatomy Toolbox" that we have written for R. In particular
the cmtk.statistics function from the main package, nat, provides the
basic functionality.

http://rpackages.ianhowson.com/cran/nat/man/cmtk.statistics.html

I suspect more people are familiar with matlab than R, so I'm sure your
script will be helpful. It is also self-contained using the included
nrrdread.m function. Incidentally we also have a full pure matlab nrrd
I/O function set here:

https://github.com/jefferislab/MatlabSupport/tree/master/nrrdio

The plus side of using R + nat is that R is free and open source and
reading the image files will be faster since it uses a cmtk command line
tool under the hood. However you must install cmtk on your system.

If you want to speed up your own script, you may want to look at using
this matlab C code library:

https://github.com/jefferislab/MatlabSupport/tree/master/teem

This will be *much* faster (5-10x for our tests) for loading gzipped
imaged data (all of the FlyLight image data that we have posted is
gripped). If loading images is the bottleneck in your current approach,
this might be worth considering.

All the best,

Greg.

PS I have taken the liberty of ccing the google group for "NeuroAnatomy
Toolbox" that we have just opened – let me know if you are ok with
that.


On 20 Apr 2015, at 15:21, Oliver Barnstedt wrote:

> Hi Greg and Mike,
> after learning that you have registered most of the JF Gal4 stacks
> last
> time I visited your place, I wrote a little Matlab script that can
> calculate the overlap of each of those lines with a self-defined
> segmented
> ROI to help me with my project, without having to go through each line
> individually.
> Well, I haven't worked on the project for some time now, but I
> suggested
> the script to some of my colleagues, and have now made a proper
> function
> out of it that seems quite accessible and easy to use.
> I thought I might share this with you in case you find it useful, and
> maybe
> you could give me feedback on it.
> I also had to manipulate the nrrdread from Matlab a bit because the
> original somehow didn't like these files.
> The output is a Matlab table and CSV file with all the Gal4 names and
> their
> respective overlap. I used ImageJ for the segmentation of my ROI and
> saved
> it as NRRD.
>
> Let me know if you find it useful or have feedback on it!
> Oliver
>
> [flylightcount.m]
>
> [nrrdread.m]


--
Gregory Jefferis, PhD Tel: +44 1223 267048
Division of Neurobiology
MRC Laboratory of Molecular Biology
Francis Crick Avenue
Cambridge Biomedical Campus
Cambridge, CB2 OQH, UK

http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
http://jefferislab.org
http://flybrain.stanford.edu
Reply all
Reply to author
Forward
0 new messages