Justify in dialog boxes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Justify in dialog boxes

AJBell
Dear List,

I've written some straight forward macros that work fine. However there are several dialog boxes that are used, and it is really rather annoying that the text and any tick box/drop down menu etc are not justified in the dialog box. Here is an example:

microscope = newArray("Old", "New");
        Dialog.create("Experiment Details");
                Dialog.addMessage("Please select which microscope was used.");
                Dialog.addChoice("Microscope:", microscope);

        Dialog.show();

Here the choice box is left justified and the OK/Cancel buttons right justified. Or here:

waitForUser("Click OK to continue");

Is it possible to make them all center justified?  

Ridiculous question I know, but to me it's like fingernails down a blackboard!

With regards,

Andrew Bell

PhD Student
Department of Infection, Immunity and Inflammation
Maurice Shock Medical Sciences Building
University of Leicester
University Road
Leicester
LE1 9HN
Reply | Threaded
Open this post in threaded view
|

Re: Justify in dialog boxes

Gabriel Landini
On Tuesday 15 Feb 2011 14:29:56 you wrote:

> Dear List,
>
> I've written some straight forward macros that work fine. However there are
> several dialog boxes that are used, and it is really rather annoying that
> the text and any tick box/drop down menu etc are not justified in the
> dialog box. Here is an example:
>
> microscope = newArray("Old", "New");
> Dialog.create("Experiment Details");
> Dialog.addMessage("Please select which microscope was used.");
> Dialog.addChoice("Microscope:", microscope);
>
> Dialog.show();
>
> Here the choice box is left justified and the OK/Cancel buttons right
> justified. Or here:
>
> waitForUser("Click OK to continue");
>
> Is it possible to make them all center justified?

Center? No please that is not nice to read and means that multiple boxes will
not be aligned vertically.

I guess that you probably have lines that appear all over the dialogue, due to
a combination of the length of the text and the default length of the box.

But look how much tidier it  appears in the example below  which have longer
lines:

microscope = newArray("Old", "New");
Dialog.create("Experiment Details");
Dialog.addMessage("Please select which microscope was used.");
Dialog.addMessage("Yes.");
Dialog.addMessage("No.");
Dialog.addMessage("Maybe.");
Dialog.addChoice("Microscope:", microscope);
Dialog.addChoice("Very long line of text:", microscope);
Dialog.addChoice("A much longer line of text than the previous one:",
microscope);
Dialog.show();

waitForUser("Click OK on the button below to continue");

Cheers

Gabriel
Reply | Threaded
Open this post in threaded view
|

Ocean Optics spectrometer file handling

Henry Barwood
In reply to this post by AJBell
Are there any ImageJ plugins that will allow you to work with saved files
from Ocean Optics Spectrometers?

Henry Barwood
Professor of Science, Earth Sciences
Department of Math and Physics
MSCX 312G
Troy University
Troy, Alabama 36082
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Ocean Optics spectrometer file handling

Bill Christens-Barry
Henry,

Not what you asked for, but I have a macro that takes a folder of OceanOptics spectrum files (tab-delimited, text format) and plots all of them in a stack. Each spectrum is scaled to its max value, and there is some other detailed markup that is done for my purposes. I could send this to you (as is) if you are interested, or modify it after I return (end of month) from travel overseas. It should be straightforward to turn this into a plugin.

Bill Christens-Barry
Reply | Threaded
Open this post in threaded view
|

Re: Ocean Optics spectrometer file handling

Henry Barwood
Hi Bill,

I would love to try it out. I'm not very good at plugins, but would be
willing to give it a shot. Thanks.

Henry

Henry Barwood
Professor of Science, Earth Sciences
Department of Math and Physics
MSCX 312G
Troy University
Troy, Alabama 36082
[hidden email]
 

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Bill
Christens-Barry
Sent: Tuesday, February 15, 2011 9:48 AM
To: [hidden email]
Subject: Re: Ocean Optics spectrometer file handling

Henry,

Not what you asked for, but I have a macro that takes a folder of
OceanOptics spectrum files (tab-delimited, text format) and plots all of
them in a stack. Each spectrum is scaled to its max value, and there is some
other detailed markup that is done for my purposes. I could send this to you
(as is) if you are interested, or modify it after I return (end of month)
from travel overseas. It should be straightforward to turn this into a
plugin.

Bill Christens-Barry
Reply | Threaded
Open this post in threaded view
|

Re: Justify in dialog boxes

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by AJBell
On Feb 15, 2011, at 9:29 AM, Andrew Bell wrote:

> Dear List,
>
> I've written some straight forward macros that work fine. However there are several dialog boxes that are used, and it is really rather annoying that the text and any tick box/drop down menu etc are not justified in the dialog box. Here is an example:
>
> microscope = newArray("Old", "New");
> Dialog.create("Experiment Details");
> Dialog.addMessage("Please select which microscope was used.");
> Dialog.addChoice("Microscope:", microscope);
>
> Dialog.show();
>
> Here the choice box is left justified and the OK/Cancel buttons right justified. Or here:
>
> waitForUser("Click OK to continue");
>
> Is it possible to make them all center justified?  
>
> Ridiculous question I know, but to me it's like fingernails down a blackboard!
You can't change the position of the "OK" and "Cancel" buttons but you can use the Dialog.setInsets(top,left,bottom) function to left justify the message and you can split it into two lines by adding a newline character ('\n'). The default insets (margins) for messages are 10, 20 and 0 pixels.

   microscope = newArray("Old", "New");
   Dialog.create("Details");
   Dialog.setInsets(5, 0, 5);
   Dialog.addMessage("Please select which\nmicroscope was used.");
   Dialog.addChoice("Microscope:", microscope);
   Dialog.show();


DialogBox.jpg (15K) Download Attachment
ATT00001..txt (22 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

tracking 4d (Manual Tracking)

ALEMBIC | Cesare
In reply to this post by Henry Barwood
Dear List,
we are trying to use Manual Tracking for a 3d timelapse (for a 3D cell
migration analysis).
Our dataset:
100 time points,
10 Z slices for each time point,
1 channel

How do we have to 'organise' all images for Manual Tracking analysis in
4D (time+Z)?
A big single stack?
or 10 time lapse (one for each slice)?
or...other?
or we have to use Image5D plugin?

Thank you so much in advance!

Cesare

_________________________________________________________________________________
Dr. Cesare Covino
ALEMBIC
Advanced Light and Electron Microscopy BioImaging Center
San Raffaele Scientific Institute
via Olgettina 58, 20132 - Milano - Italy
ALEMBIC webpage: www.sanraffaele.org/research/alembic



-----------------------------------------------------------------------------------
SOSTIENI ANCHE TU LA RICERCA DEL SAN RAFFAELE.
NON C'E' CURA SENZA RICERCA.
Per donazioni: ccp 42437681 intestato a Fondazione Arete' Onlus del San Raffaele.
Per informazioni: tel. 02.2643.4461 - www.sanraffaele.org
Reply | Threaded
Open this post in threaded view
|

Re: Ocean Optics spectrometer file handling

Bill Christens-Barry
In reply to this post by Henry Barwood
Henry,

Here's the text of a starter macro for plotting Ocean Optics spectrometer files. Comments in the macro describe input file format etc. Note that this plots actual data values; they are not scaled to the maximum intensity as my earlier message described.

hth,

Bill Christens-Barry


// Author: Bill Christens-Barry
// License: free in every sense
// Name: EQPI-OOSpectralFolderBatcher.txt
// Desc: Plots all OceanOptics spectrum files in a user-chosen folder
// Inputs: folder containing only OceanOptics spectrum files, each saved as a tab-delimited text file with header (first 17 header lines of each file are ignored)
// Output: stack of plotted spectra; integrated intensity and coordinates of peak intensity printed in plot window; data values printed in Log window



// Recursively plots the files in a user-chosen directory,
// then creates a stack from these files. List of data
// is printed in Log window.
// File header data (first 17 lines) is discarded.

macro "EQPI-OOSpectralFolderBatcher [F1]" {
    start = getTime();
    print("\\Clear");

    dir = getDirectory("Choose a Directory ");
    listOut = getFileList(dir);
    print("\\Clear");
    print("Chosen directory: " + dir + " ; number of files: " + listOut.length);
    print("");
   
    setBatchMode(1);
    bl = 17;
    x = newArray(2048);
    y = newArray(2048);

    for (i = 0; i < listOut.length; i++) {
        if (endsWith(listOut[i], ".txt")) {
            fullPath = dir + listOut[i];
            print((i + 1) + " : " + listOut[i]);
            lines = split(File.openAsString(dir + listOut[i]),"\n");
            file = File.name;
            print("");
           
            imin = 2047;
            imax = 0;
            xmin = 2000;
            xmax = 0;
            ymin = 4000.0;
            ymax = 0.0;
            ysum = 0.0;
            for (j = 0; j < 2048; j++) {
                parts = split(lines[j + bl],"\t");
                x[j] = parseFloat(parts[0]);
                y[j] = parseFloat(parts[1]);
                ysum += y[j];
                if (y[j] > ymax) {
                    xmax = x[j];
                    ymax = y[j];
                    imax = j;
                }
                if (y[j] < ymin &&amp; j > 0) {
                    xmin = x[j];
                    ymin = y[j];
                }
                print(j + "  " + x[j] + "  " + y[j]);
            }
           
            print("");
            for (j = 1; j < 2048; j++) {
                y[j] = y[j] - ymin;
            }
           
            Plot.create(file, "Wavelength (nm)", "Intensity (a.u.)");
            Plot.setLimits(x[0], x[2047], 0, 4000);
            Plot.setColor("red");
            Plot.add("line", x, y);
            Plot.addText("Peak hgt. max (" + ymax + ")       @ " + d2s(xmax, 2) + " nm", 0.4, 0.08);
            Plot.addText("Sum = " +  d2s(ysum, 2), 0.1, 0.08);
            Plot.show();
            if (is("Caps Lock Set"))
                exit;
            print("");
        }
    }
    run("Images to Stack", "name=Spectra title=[] use");
    setBatchMode(0);
}