Dear all,
In the release notes of the last version of NeuronJ (1.1, see http://imagescience.bigr.nl/meijering/software/neuronj/releases.html), is stated : "It is now possible to export the tracing vertex coordinates as tab- or comma-delimited text files. This facilitates using the tracings in other programs or plugins, such as for example the Straighten plugin." That's precisely what I'm trying to do. I get delimited text files corresponding to NeuronJ tracings, but how to get from those files to draw a tracing in the Straighten Plugin ? My idea is to first create a segmented/curved linear ROI from the file, and then laungh the Straighten Plugin. Do anybody know how I can get a ROI to be build from a text file containing coordinates ? Secondly, do you think it's doable to control either NeuronJ or Straighten via a macro ? What arguments can I pass to Straighten to automate the Straighten procedure ? Do I have to learn Java and write a proper plugin for that ? The possibility of controling/automating complex plugins like NeuronJ and Straighten is what motivates me to switch from Macro writing to Plugin writing. Is it possible anyway ? The source of the NeuronJ plugin is not avalaible, even if I could find a copy of the 1.0 source somewhere (previous version was open). -- Christophe Leterrier Postdoc INSERM UMR641 Neurobiology of ionic channels IFR Jean Roche - Mediterranee University Marseille, France |
here is a macro that creates a polyline selection from a excel file
containing the coordinates of a trace from Neuronj: macro "NjTraces"{ dir=getDirectory("image"); ntraces=getFileList(dir+"\\traces"); j=ntraces.length; for (k=1;k<j;k++){ r=File.openAsString(dir+"traces\\trace.N"+k+".xls"); s=split(r, "\n"); l=lengthOf(s); startx=newArray(l); starty=newArray(l); for (i=0; i<l;i++){ coord=split(s[i], "\t"); startx[i]=coord[0]; } for (i=0; i<l;i++){ coord=split(s[i], "\t"); starty[i]=coord[1]; } makeSelection("polyline", startx, starty); roiManager("Add"); } } you'll have to export the traces as "tab-delimited text files: separate file for each tracing" and save it as an excel file. also the traces must be saved (rename to "trace") in a new folder (called "traces") in the directory containing the image. it can still be improved.... hope it helps. silviu > > My idea is to first create a segmented/curved linear ROI from the file, > and then laungh the Straighten Plugin. Do anybody know how I can get a > ROI to be build from a text file containing coordinates ? > -- Silviu Rusu, Erasmus MC Rotterdam Ee 1230 Tel: +31 10 46 38094 Fax: +31 10 40 89459 Dr. Molewaterplein 50 NL-3015 GE Rotterdam email: [hidden email] web: http://www2.eur.nl/fgg/neuro/ |
Thank you very much ! I'll try your code and modify it to my needs.
Christophe Leterrier
|
Free forum by Nabble | Edit this page |