retina
Class OIDReconstructor

java.lang.Object
  |
  +--io.OpenPreviewDialog
        |
        +--retina.OIDReconstructor
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.ItemListener, java.awt.event.WindowListener

public class OIDReconstructor
extends OpenPreviewDialog
implements java.awt.event.ActionListener

OID reconstructor with directory navigation. Can sort and register OID image sequences. (c) 2003 Michael Abramoff. All rights reserved.


Field Summary
protected  java.awt.Button buttonSort
           
protected  java.awt.Button buttonSortNonStimulus
           
protected  java.awt.Checkbox checkAvg
           
protected  java.awt.Checkbox checkLast2
           
protected  java.awt.Checkbox checkLinearCorrect
           
protected  java.awt.Checkbox checkReg
           
protected  java.awt.Checkbox checkSubOpp
           
protected static boolean doAvg
           
protected static boolean doLast2
           
protected static boolean doLinearCorrect
           
protected static boolean doOnlyStim
           
protected static boolean doRegister
           
protected static boolean doSubOpp
           
protected static int end
           
protected  java.awt.TextField fieldEnd
           
protected  java.awt.TextField fieldGaussian
           
protected  java.awt.TextField fieldScaling
           
protected  java.awt.TextField fieldStart
           
protected static int length
           
protected  boolean opening
           
protected static float scale
           
protected static float scaling
           
protected static int start
           
protected static java.lang.String startdir
           
protected  java.awt.TextField textEpochLength
           
 
Fields inherited from class io.OpenPreviewDialog
cancel, canceling, canListRoots, choiceDir, dialog, directory, dirs, filter, indexOfCurrentDir, list, names, open, panel, textarea, validFiles
 
Constructor Summary
OIDReconstructor(java.lang.String title, java.lang.Object filter, java.lang.String directory)
          Open a preview open dialog, a dialog that shows a list of files in the directory, and shows a text (currently header text) related to that file, to ease selection.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
protected  float getFloatField(java.awt.TextField t)
          Get the value of a Textfield as a float.
protected  int getIntField(java.awt.TextField t)
          Get the value of a Textfield as an int.
protected  void showFileHeader(java.io.File file)
          A file has been selected.
protected  void sortByCondition(java.lang.String directory, java.lang.String[] epochNames, boolean useStimulus)
          Sort the selected epochs (from a single experiment) epochNames on stimulus condition and save the frames as a single file in the same format.
protected  java.util.Vector[] sortNamesByCondition(java.lang.String directory, java.lang.String[] epochNames)
          Sort the names of the selected epochs (from a single experiment) on stimulus condition.
protected  java.lang.String validFileDescription(java.io.File file)
          Modify the name of the file if you want.
 
Methods inherited from class io.OpenPreviewDialog
addPathTree, getDirectory, getFileNames, getTree, itemStateChanged, selectedFileNames, showDirs, showFiles, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkLinearCorrect

protected java.awt.Checkbox checkLinearCorrect

checkSubOpp

protected java.awt.Checkbox checkSubOpp

checkAvg

protected java.awt.Checkbox checkAvg

checkReg

protected java.awt.Checkbox checkReg

checkLast2

protected java.awt.Checkbox checkLast2

fieldStart

protected java.awt.TextField fieldStart

fieldEnd

protected java.awt.TextField fieldEnd

fieldScaling

protected java.awt.TextField fieldScaling

textEpochLength

protected java.awt.TextField textEpochLength

fieldGaussian

protected java.awt.TextField fieldGaussian

buttonSort

protected java.awt.Button buttonSort

buttonSortNonStimulus

protected java.awt.Button buttonSortNonStimulus

doLinearCorrect

protected static boolean doLinearCorrect

scale

protected static float scale

doSubOpp

protected static boolean doSubOpp

doOnlyStim

protected static boolean doOnlyStim

doRegister

protected static boolean doRegister

doAvg

protected static boolean doAvg

doLast2

protected static boolean doLast2

start

protected static int start

end

protected static int end

length

protected static int length

scaling

protected static float scaling

startdir

protected static final java.lang.String startdir

opening

protected boolean opening
Constructor Detail

OIDReconstructor

public OIDReconstructor(java.lang.String title,
                        java.lang.Object filter,
                        java.lang.String directory)
Open a preview open dialog, a dialog that shows a list of files in the directory, and shows a text (currently header text) related to that file, to ease selection. The user can select Open or Cancel.
Parameters:
title - the title of the dialog
directory - the directory the dialog will open
filter - a FilenameFilter that filters names for display.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class OpenPreviewDialog

sortByCondition

protected void sortByCondition(java.lang.String directory,
                               java.lang.String[] epochNames,
                               boolean useStimulus)
Sort the selected epochs (from a single experiment) epochNames on stimulus condition and save the frames as a single file in the same format. Also saves a .dat file with all common parameters of the data files. If useStimulus is true, only the stimulus frames will be used. If useStimulus is false, only non-stimulus frames will be used (i.e. BEFORE start of stimulus). The file saved will have the stimulus/non-stimulus frames of all epochs in epochNames sorted on stimulus condition.
Parameters:
directory - the directory in which the epochs are located.
names - the names of the OID files that should be sorted.
useStimulus - if true, only stimulus frames (of all conditions) are used, if false, only non-stimulus frames used.

sortNamesByCondition

protected java.util.Vector[] sortNamesByCondition(java.lang.String directory,
                                                  java.lang.String[] epochNames)
Sort the names of the selected epochs (from a single experiment) on stimulus condition. epochNames is sorted IN PLACE.
Parameters:
directory - the directory in which the epochs are located.
names - the names of the OID files that should be sorted, MODIFIED.
Returns:
a Vector [], an array of Vectors with a Vector with String for each condition. ([0] contains the Vector with all names of the first condition, etc.

showFileHeader

protected void showFileHeader(java.io.File file)
A file has been selected. Show all data available.
Overrides:
showFileHeader in class OpenPreviewDialog

validFileDescription

protected java.lang.String validFileDescription(java.io.File file)
Modify the name of the file if you want. Here the filename is returned.
Overrides:
validFileDescription in class OpenPreviewDialog
Parameters:
file - the File.
Returns:
a String.

getIntField

protected int getIntField(java.awt.TextField t)
Get the value of a Textfield as an int.
Parameters:
t - a TextField.
Returns:
an int with the value of the text field, 0 if an error.

getFloatField

protected float getFloatField(java.awt.TextField t)
Get the value of a Textfield as a float.
Parameters:
t - a TextField.
Returns:
a float with the value of the text field, 0 if an error.