I am trying to use bUnwarpJ from a macro in ImageJ (not Fiji) on a linux box running Fedora 25.
My commands inthe macro are: run("bUnwarpJ", "source_image=blueimage target_image=greenimage registration=Mono image_subsample_factor=0 initial_deformation=[Very Coarse] final_deformation=Coarse divergence_weight=0 curl_weight=0 landmark_weight=0 image_weight=1 consistency_weight=10 stop_threshold=0.01 save_transformations"); selectImage("Registered Source Image"); close(); call("bunwarpj.bUnwarpJ_.elasticTransformImageMacro", "/tmp/green.jpg", "/tmp/blue.jpg", "blueimage_direct_transf.txt", "/tmp/bluegreen.tif"); I get the error that "blueimage_direct_trans.txt" does not exist. When I look for it, I note that the data is there, but it's in a file named "get_image=greenimage"! Any help would be appreciated. thanks, billo |
Hello Billo,
It looks like your path to "blueimage_direct_trans.txt" is not complete. Have you tried using the whole path to the file? On Sat, Apr 15, 2017 at 2:56 AM, billo <[hidden email]> wrote: > I am trying to use bUnwarpJ from a macro in ImageJ (not Fiji) on a linux > box > running Fedora 25. > > My commands inthe macro are: > > run("bUnwarpJ", "source_image=blueimage target_image=greenimage > registration=Mono image_subsample_factor=0 initial_deformation=[Very > Coarse] > final_deformation=Coarse divergence_weight=0 curl_weight=0 > landmark_weight=0 > image_weight=1 consistency_weight=10 stop_threshold=0.01 > save_transformations"); > selectImage("Registered Source Image"); > close(); > > call("bunwarpj.bUnwarpJ_.elasticTransformImageMacro", "/tmp/green.jpg", > "/tmp/blue.jpg", "blueimage_direct_transf.txt", "/tmp/bluegreen.tif"); > > I get the error that "blueimage_direct_trans.txt" does not exist. > > When I look for it, I note that the data is there, but it's in a file named > "get_image=greenimage"! > > Any help would be appreciated. > > thanks, > > billo > > > > -- > View this message in context: http://imagej.1557.x6.nabble. > com/Odd-bUnwarpJ-behavior-help-tp5018552.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Ignacio Arganda-Carreras, Ph.D. Ikerbasque Research Fellow Departamento de Ciencia de la Computacion e Inteligencia Artificial Facultad de Informatica, Universidad del Pais Vasco Paseo de Manuel Lardizabal, 1 20018 Donostia-San Sebastian Guipuzcoa, Spain Phone : +34 943 01 73 25 Website: http://sites.google.com/site/iargandacarreras/ <http://biocomp.cnb.csic.es/~iarganda/index_EN.html> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thanks for the reply! That doesn't change anything, unfortunately. However, if I rename the file "get-image=greenimage" as blueimage_direct_transf.txt, it will read it, and move on. The transfer file is getting written. It's just misnamed a I downloaded Fiji, and get the same error. Two asides: 1) This works fine using an older version of bUnwarpJ , and ImageJ 1.48a. I don't know which version of bUnwarpJ I have installed on the old ImageJ, but it's a couple of years old, at least. I know that I invoked it using call("bUnwarpJ_.elasticTransformImageMacro", ...) instead of call ("bunwarpj.bUnwarpJ_.elasticTransformImageMacro", ,,,) 2) This is part of an old script, er, macro, I wrote some time ago to clean up brightfield microscopy images. This part is an attempt to lessen chromatic aberration. It works by: a) Split the rgb image into red, green and blue b) Create edge strength images c) Use the green edge image as the base, and warp the blue and red edge images to the green image d) Apply the transformations to the "regular" red, green, and blue images e) Restack them into a rgb image. It works *farily* well. Or, rather, it worked fairly well before I upgraded ImageJ. 3) Since, as noted in #2 above, I run this on the blue and red images, I get the same error twice. However, the second incorrectly named transfer file is named, of all things, "et-image=greenimage" instead of "get-image-greenimage." Thanks! billo On Sat, 2017-04-15 at 08:16 -0700, Ignacio Arganda-Carreras-2 [via ImageJ] wrote: Hello Billo, |
In reply to this post by Ignacio Arganda-Carreras-2
Here's a little bit more info. I took out everything from the macro except reading the files and running bUnwarpJ. The problem persists. First, here's the linux bash script that invokes ImageJ: % cat jnk.sh #!/bin/sh command='./jre/bin/java -Xmx2048m -jar ij.jar -macro billo1.txt "/home/oliver/micros/baby_micros/orig/DSC_2261.JPG /home/oliver/micros/baby_micros/orig/DSC_22 63.JPG"' eval $command Here's the modified macro in its entirety: %cat billo1.txt position=indexOf(tmpfiles," "); firstfile=substring(tmpfiles,0,position); endpos=lengthOf(tmpfiles); secondfile=substring(tmpfiles,position+1,endpos); open(firstfile); open(secondfile); run("bUnwarpJ", "source_image=firstfile target_image=secondfile registration=Mono image_subsample_factor=0 initial_deformation=[Very Coarse] final_deformation =Coarse divergence_weight=0 curl_weight=0 landmark_weight=0 image_weight=1 consistency_weight=10 stop_threshold=0.01 save_transformations"); close(); run("Quit"); Running this results in the writing of a file named "'get_image=secondfile'" that has the information that should be in firstfile_direct_transf.txt. billo On Sat, 2017-04-15 at 08:16 -0700, Ignacio Arganda-Carreras-2 [via ImageJ] wrote: Hello Billo, |
Free forum by Nabble | Edit this page |