Dear Nelly,
You dreamt about it, I made it!!! Namely I modified the UnwarpJ plugin so that in order to use the macro commands "-transform" or "-transformMemory" you don’t need any more to define a target_image. The data for the target_image width and height being now saved within the transformation_file. And in the case you want to reuse previously generated transformation_files with this new version, you just need to replace: Intervals=1 By: Width=247 Height=511 Intervals=1 With 247 and 511 respectfully the width and height of your transformation_file. I also got rid of the "numberOfIntervalsOfTransformation" method which was opening and closing the transformation_file just in order to read the number of intervals by using now a two dimensional ArrayList. Nevertheless I transform again this two dimensional ArrayList into a two dimensional Array just before using the "applyTransformationToSource" method since it would have been too much work to stick with the ArrayList within the whole plugin. In the case you are interested into this new plugin, you can download it here: http://punias.free.fr/Unwarp/NEW/UnwarpJ_.jar and try it with the following macro: http://punias.free.fr/Unwarp/NEW/Macro_UnwarpJ_Stack.ijm with the picture stack: http://punias.free.fr/Unwarp/Stack.tif and transformation_file: http://punias.free.fr/Unwarp/NEW/AVG_-1_transf.txt Feel free to contact me for any additional question or purpose. My best regards, Philippe -------- Message original -------- Sujet: RE: Apply bUnwarpJ in macro Date: Mardi 10 Mai 2016 15:14 CEST De: "Philippe CARL" <[hidden email]> Pour: <[hidden email]> Références: <[hidden email]> <CADN69y=n0uuhanG7Gio850kXen=i=[hidden email]> <[hidden email]> <[hidden email]> Dear Nelly, You will find under the following link: http://punias.free.fr/Unwarp/Stack.tif an example stack obtained from an image acquired with an image splitter device (type Gemini or Optosplit II). For which I created the following macro: http://punias.free.fr/Unwarp/Macro_UnwarpJ_Stack.ijm that is working with this plugin: http://punias.free.fr/Unwarp/UnwarpJ_.jar what the macro does is, for each picture within the stack, to split the picture as the red and green channel, applies the transformation using the transformation file generated previously and stored on the HD and output the transformed picture for which I create a stack of the corrected pictures at the end. Concerning your question, you can find its answer under the following link: http://bigwww.epfl.ch/thevenaz/UnwarpJ/ namelly "The source image is the one to which the transformation will be applied. The target image is used to know the dimension of the output image and must be the same image that was used during the alignment step since the deformation is computed for its specific size." And indeed (and I completely agree with you, with the fact that) the plugin could be really simplified if the "dimension of the output image" would simply be saved within the transformation file and thus there would only be the need of an input picture and transformation file as input for launching the plugin. Even more, and I really don't want to hurt the authors of this plugin which mathematically is really over my level of understanding, the architecture of the plugin is extremely complicated and should be rethought and rewritten. As an example, the plugin is not using the GenericDialog class but recreating the wheel using other classes. BUT, I don't know this, maybe had the first version of this plugin been written before the creation of these classes. The issue is that the reformatting I'm talking about would require way more time and investment than the 1-2 hours of small updates I added to the code (respecting its philosophy and formatting as it was) for the applications of a colleague (who needed this for the day before yesterday). As for the request of Jan of pulling a request on the update I'm not against it, but the code I started from (found @ http://bigwww.epfl.ch/thevenaz/UnwarpJ/) seems quite different than the one within the Fiji version of the algorithm. Nevertheless I left the source code of my updates within the jar file @ http://punias.free.fr/Unwarp/UnwarpJ_.jar for whoever to look at it and copy it. I hope I helped you to move further. My best regards, Philippe Philippe CARL Laboratoire de Biophotonique et Pharmacologie UMR 7213 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 41 84 -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de nellypledge Envoyé : mardi 10 mai 2016 13:45 À : [hidden email] Objet : Re: Apply bUnwarpJ in macro Hi Guys, thanks for the feedback. The one things that keeps throwing me is the fact you need the target and source repeatedly. Surely once I've created a transform file I can apply it to one image (I'm assuming that I'd apply a forward transform to a source image, right?). Why don't we just have the source, transform and output? Maybe I'm missing something... For your reference I want to use this plugin to map my green channel camera image back to the red channel. I acquired images with a full field of mutlicolor beads to create the transform. Using the target, source, transform and output, how would that look? Would the target and source be the bead image of red and green respectively, and then the transform acts on the output file? I would be applying this to potentially large zstacks and would probable need the memory adapted version. I'm happy to work with github to keep things current. Philippe, if you plan to update the repository, I'll wait for you, but if you foresee potential time delays, I'm happy to figure that out and update things. Thanks Neil -- View this message in context: http://imagej.1557.x6.nabble.com/Apply-bUnwarpJ-in-macro-tp5016374p5016383 .html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |