Not sure if I'm the only one that encounters this, but often I'm faced with
opening many raw (headerless) files, with several different settings (width, height, gap, offset, etc.). To go back and forth between different image sets requires changing these each time. What about creating a combobox with presets and/or recently used settings? I figure this would entail adding a single combobox, and two buttons (Save, Remove). Would anyone else find this useful and would the changes likely be accepted? Thanks, -Josh -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
2013/9/5 Josh Doe <[hidden email]>:
> Not sure if I'm the only one that encounters this, but often I'm faced with > opening many raw (headerless) files, with several different settings > (width, height, gap, offset, etc.). To go back and forth between different > image sets requires changing these each time. > > What about creating a combobox with presets and/or recently used settings? > I figure this would entail adding a single combobox, and two buttons (Save, > Remove). This could be easily accomplished by using a macro, right? Best, José. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Josh Doe
Hi Josh,
what about different macros for your different file types? Use Plugins>Macros>Record to record how you open these files, and delete the filename from the recorded strings, then the macro will ask for the filename. Another possibility: If your files have well-defined lengths, you may also have one macro for all, selecting the parameters according to file length. It's similar if one can deduce the parameters from the file name. Use path=File.openDialog("Raw file to open"), then examine File.length(path) and/or File.name (the filename without the directory). Michael ________________________________________________________________ On Sep 5, 2013, at 17:37, Josh Doe wrote: > Not sure if I'm the only one that encounters this, but often I'm faced with > opening many raw (headerless) files, with several different settings > (width, height, gap, offset, etc.). To go back and forth between different > image sets requires changing these each time. > > What about creating a combobox with presets and/or recently used settings? > I figure this would entail adding a single combobox, and two buttons (Save, > Remove). > > Would anyone else find this useful and would the changes likely be accepted? > > Thanks, > -Josh > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by José María Mateos
On Thu, Sep 5, 2013 at 11:42 AM, José María Mateos <[hidden email]>wrote:
> 2013/9/5 Josh Doe <[hidden email]>: > > Not sure if I'm the only one that encounters this, but often I'm faced > with > > opening many raw (headerless) files, with several different settings > > (width, height, gap, offset, etc.). To go back and forth between > different > > image sets requires changing these each time. > > > > What about creating a combobox with presets and/or recently used > settings? > > I figure this would entail adding a single combobox, and two buttons > (Save, > > Remove). > > This could be easily accomplished by using a macro, right? > That would be one way to do it, but it would require manually changing the macro to point to the file I want to open, and new macros would have to be created for every combination of settings. My use case is using File->Import->Raw or drag-and-dropping to open many files with many different settings (I have HandleExtraFileTypes assume a file is raw if it fails every other test), which would make the macro approach ineffective. Seeing a similar suggestion from Michael, his idea of having a macro ask for the filename is an improvement, however it still requires managing macros, adding them to shortcuts/toolbars/etc. I see dozens of different settings, including new ones quite frequently, so managing these macros and easily going back and forth doesn't seem enjoyable. -Josh -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Hi Josh,
how do you determine the correct settings for the import dialog, when you do it by hand? Is there really no way to automate what you are doing manually? As I said, the macro could determine the file size, and/or analyze the file name. It might even read the beginning of a file if some information can be retrieved from a header (binary or text). Or it might read a special file from the image directory containing a description of the image files... Eventually, your HandleExtraFileTypes could forward the raw files to a macro or plugin that does all this work... ---- One more possibility: The defaults of the ImportDialog are saved in the prefs. See http://imagej.nih.gov/ij/source/ij/io/ImportDialog.java You can use the macro language to read/write the prefs, e.g. type = call("ij.Prefs.get", "raw.type","8-bit"); width = parseInt(call("ij.Prefs.get", "raw.width","512")); and call("ij.Prefs.set", "raw.type", type); call("ij.Prefs.set", "raw.width", toString(width)); Thus, you could build your own set of macros, one for each file type. Alternatively, have one macro that asks the user which of many possible sets of parameters should be used to initialize the 'import raw' dialog. Michael ________________________________________________________________ On Sep 5, 2013, at 18:04, Josh Doe wrote: > On Thu, Sep 5, 2013 at 11:42 AM, José María Mateos <[hidden email]>wrote: > >> 2013/9/5 Josh Doe <[hidden email]>: >>> Not sure if I'm the only one that encounters this, but often I'm faced >> with >>> opening many raw (headerless) files, with several different settings >>> (width, height, gap, offset, etc.). To go back and forth between >> different >>> image sets requires changing these each time. >>> >>> What about creating a combobox with presets and/or recently used >> settings? >>> I figure this would entail adding a single combobox, and two buttons >> (Save, >>> Remove). >> >> This could be easily accomplished by using a macro, right? >> > > That would be one way to do it, but it would require manually changing the > macro to point to the file I want to open, and new macros would have to be > created for every combination of settings. My use case is using > File->Import->Raw or drag-and-dropping to open many files with many > different settings (I have HandleExtraFileTypes assume a file is raw if it > fails every other test), which would make the macro approach ineffective. > > Seeing a similar suggestion from Michael, his idea of having a macro ask > for the filename is an improvement, however it still requires managing > macros, adding them to shortcuts/toolbars/etc. I see dozens of different > settings, including new ones quite frequently, so managing these macros and > easily going back and forth doesn't seem enjoyable. > > -Josh > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
I completely agree with Michael, if you just want to import images with a
format given, or massively open and manipulate an image stack a good solution may be to write a good macro or, better yet, developing a custom plugin to recognize all the requeriments you need. Regards, Alberto Hornero. On Thu, Sep 5, 2013 at 6:39 PM, Michael Schmid <[hidden email]>wrote: > Hi Josh, > > how do you determine the correct settings for the import dialog, when you > do it by hand? > Is there really no way to automate what you are doing manually? > > As I said, the macro could determine the file size, and/or analyze the > file name. It might even read the beginning of a file if some information > can be retrieved from a header (binary or text). Or it might read a special > file from the image directory containing a description of the image files... > > Eventually, your HandleExtraFileTypes could forward the raw files to a > macro or plugin that does all this work... > > ---- > > One more possibility: > > The defaults of the ImportDialog are saved in the prefs. See > http://imagej.nih.gov/ij/source/ij/io/ImportDialog.java > > You can use the macro language to read/write the prefs, e.g. > > type = call("ij.Prefs.get", "raw.type","8-bit"); > width = parseInt(call("ij.Prefs.get", "raw.width","512")); > > and > > call("ij.Prefs.set", "raw.type", type); > call("ij.Prefs.set", "raw.width", toString(width)); > > Thus, you could build your own set of macros, one for each file type. > Alternatively, have one macro that asks the user which of many possible > sets of parameters should be used to initialize the 'import raw' dialog. > > Michael > ________________________________________________________________ > > On Sep 5, 2013, at 18:04, Josh Doe wrote: > > > On Thu, Sep 5, 2013 at 11:42 AM, José María Mateos <[hidden email] > >wrote: > > > >> 2013/9/5 Josh Doe <[hidden email]>: > >>> Not sure if I'm the only one that encounters this, but often I'm faced > >> with > >>> opening many raw (headerless) files, with several different settings > >>> (width, height, gap, offset, etc.). To go back and forth between > >> different > >>> image sets requires changing these each time. > >>> > >>> What about creating a combobox with presets and/or recently used > >> settings? > >>> I figure this would entail adding a single combobox, and two buttons > >> (Save, > >>> Remove). > >> > >> This could be easily accomplished by using a macro, right? > >> > > > > That would be one way to do it, but it would require manually changing > the > > macro to point to the file I want to open, and new macros would have to > be > > created for every combination of settings. My use case is using > > File->Import->Raw or drag-and-dropping to open many files with many > > different settings (I have HandleExtraFileTypes assume a file is raw if > it > > fails every other test), which would make the macro approach ineffective. > > > > Seeing a similar suggestion from Michael, his idea of having a macro ask > > for the filename is an improvement, however it still requires managing > > macros, adding them to shortcuts/toolbars/etc. I see dozens of different > > settings, including new ones quite frequently, so managing these macros > and > > easily going back and forth doesn't seem enjoyable. > > > > -Josh > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Michael Schmid
On Thu, Sep 5, 2013 at 12:39 PM, Michael Schmid <[hidden email]>wrote:
> Hi Josh, > > how do you determine the correct settings for the import dialog, when you > do it by hand? > Sometimes we capture imagery and can save metadata (embedded or sidecar), other times we have to save as straight raw, or we'll be provided raw imagery and have no control over file naming or directory structure. > [...] > The defaults of the ImportDialog are saved in the prefs. See > http://imagej.nih.gov/ij/source/ij/io/ImportDialog.java > [...] > Thus, you could build your own set of macros, one for each file type. > Alternatively, have one macro that asks the user which of many possible > sets of parameters should be used to initialize the 'import raw' dialog. > I think this approach would get me 90% of the way there, and is certainly simple to implement. Thanks, -Josh -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by José María Mateos
Dear Josh,
Using the LOCI plugin will provide many extensions to the macro language for extracting metadata such as image size, bit-depth (file and digitization depths), capture type, etc. Glen MacDonald Core for Communication Research Virginia Merrill Bloedel Hearing Research Center Cellular Morphology Core Center on Human Development and Disability Box 357923 University of Washington Seattle, WA 98195-7923 USA (206) 616-4156 [hidden email] On Sep 5, 2013, at 8:42 AM, José María Mateos <[hidden email]> wrote: > 2013/9/5 Josh Doe <[hidden email]>: >> Not sure if I'm the only one that encounters this, but often I'm faced with >> opening many raw (headerless) files, with several different settings >> (width, height, gap, offset, etc.). To go back and forth between different >> image sets requires changing these each time. >> >> What about creating a combobox with presets and/or recently used settings? >> I figure this would entail adding a single combobox, and two buttons (Save, >> Remove). > > This could be easily accomplished by using a macro, right? > > Best, > > José. > > -- > 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 |