retina
Class ScriptProcessor

java.lang.Object
  |
  +--retina.ScriptProcessor

public class ScriptProcessor
extends java.lang.Object

Class to process / analyze OID files and directories of OID using a script file. Format of scriptfile:

 // C comments permitted
  = 
  = 
 waveform = , , ...
 masktype = 
 analyze = 
 file, file, file 
 file, file, file 
 ...
 
Parameters must come before the file name set(s) that you want to set those parameters for. Special keywords are waveform, masktype and analysis. Waveform has a list of waveform values, while masktype and analysis have a textual parameter defining the masktype and analysis type. The analyzer class name must be an existing subclass of OIDBaseAnalyzer. Copyright (c) 1999-2004, Michael Abramoff. All rights reserved.


Field Summary
protected  int aggregateCounter
           
static int AGGREGATESAVE
           
static int ANALYZE
           
static int ANALYZE_AMPLITUDE
           
static int ANALYZE_AUTOSCALING
           
static int ANALYZE_BAG
           
static int ANALYZE_CONDS
           
static int ANALYZE_FIRSTFRAME
           
static int ANALYZE_FOVEAX
           
static int ANALYZE_FOVEAY
           
static int ANALYZE_MASKFILE
           
static int ANALYZE_PCA
           
static int ANALYZE_REGISTER
           
static int ANALYZE_REGISTER_ROISIZE
           
static int ANALYZE_REGISTER_ROIX
           
static int ANALYZE_REGISTER_ROIY
           
static int ANALYZE_ROI
           
static int ANALYZE_ROITC
           
static int ANALYZE_START
           
static int ANALYZE_TIMECOURSE
           
static int ANALYZE_USECOND
           
protected  OIDBaseAnalyzer analyzer
           
protected  java.lang.String[] condStrings
          Contains the condition names.
static int CONFIDENCELIMIT
           
protected  java.util.Hashtable dict
           
protected  java.lang.String directory
          The working directory from which you are analyzing, i.e.
static java.lang.String directoryResults
           
static int DISPLAY_SCALING
           
static int DISTANCEXT
           
static int DISTANCEXVERTICAL
           
static int DISTANCEYHORIZONTAL
           
static int DISTANCEYT
           
protected  boolean doExecute
           
protected  boolean doRegistration
           
static int END
          The last frame at which the stimulus was on, or the end of the stimulus timecourse.
protected  java.lang.String filesDirectory
          The directory where the sequence files are located.
protected  int frameHeight
           
static int FRAMEHEIGHT
           
protected  int frameWidth
           
static int FRAMEWIDTH
           
static int HBARHEIGHT
           
static int HBARWIDTH
           
static int HN
           
static int HSPACING
           
static int HSTART
           
protected  ij.ImagePlus impAnalysis
           
static int LENGTH
          The number of frames for each condions.
protected  java.lang.String mapfile
           
protected  java.lang.String maskfile
           
static int MASKFILE
           
static int MASKFREQUENCY
           
static int MASKSCALE
           
static int MASKTYPE
           
static int MASKTYPE_BARS
           
static int MASKTYPE_BLOCKS
           
static int MASKTYPE_CENTRAL
           
static int MASKTYPE_DIAG
           
static int MASKTYPE_PANELS
           
static int MASKTYPE_T
           
static int OUTPUTTAG
           
protected  float[] parameters
          Contains the parameters that can be set.
protected  java.lang.String[] parameterStrings
          Contains the parameters that can be set.
protected  int[] randomblock
          May contain permuted random block for stimulus conditions.
static int RUN
           
protected  java.lang.String scriptFilePath
          The name of the file that controls this OIDFileProcessor.
static int SKIPODDS
           
static int START
           
static int STIM_BARWIDTH
           
static int STIM_CHECKERSIZE
           
static int STIM_IDLE
           
static int STIM_ISOLUMINANCE
           
static int STIM_RANDOMBLOCK
           
static int STIM_TYPE
           
static int TIMEFRAME
           
static int UNIQUECONDS
           
static int UNIQUECONDSINFILE
           
static int VBARHEIGHT
           
static int VBARWIDTH
           
protected  int verbosity
           
static int VN
           
static int VSPACING
           
static int VSTART
           
protected  float[] waveform
          May contain waveform of signal.
static int WAVEFORM
           
static int XCENTER
          Approximate position of fovea.
static int YCENTER
           
 
Constructor Summary
ScriptProcessor(java.lang.String directory, java.lang.String scriptFilePath)
          Create a new OIDFileProcessor to process the control file.
ScriptProcessor(java.lang.String directory, java.lang.String scriptFilePath, boolean doExecute)
          Create a new OIDFileProcessor to process the control file.
ScriptProcessor(java.lang.String directory, java.lang.String scriptFilePath, OIDBaseAnalyzer analyzer)
          Create a new OIDFileProcessor that can call back to an analyzer.
 
Method Summary
protected  float[][] aggregateFrames(float[][] experiment, float[][] a)
          Aggregate frames (add in the correct order) in experiment into the existing image array a.
protected  float[][] aggregateFrames(ij.ImagePlus imp, float[][] a)
          Aggregate frames (add in the correct order) in imp into the existing image array a.
protected static void checkResultsDirectory(java.lang.String directory)
          Check whether directoryResults exists.
 float get(int ix)
           
 float get(java.lang.String name)
           
 int getAnalyzeStart()
           
 java.lang.String[] getCondStrings()
           
 java.lang.String getDirectory()
           
protected static ij.io.FileInfo getFileInfo(java.lang.String fileName, java.lang.String directory, int width, int height)
          FileInfo raw format object for Dan's format files.
 float[][] getFittedMasks()
          Get the requested mask files, used to indicate which pixels on the image belong to which class.
protected  float[][] getFrames(int i, java.lang.String[] names, java.lang.String directory)
          Get a frame array from an array of filenames names, each name pointing to an ImagePlus containing the same number of frames and conditions.
 float[][] getFrames(int j, java.lang.String name, java.lang.String directory, ij.ImagePlus imp)
          Make a frame array out of the ImagePlus name.
 int getHeight()
           
 java.lang.String getKeyword(int dictionaryIndex)
           
 java.lang.String getMaskName()
           
protected  ij.process.ImageProcessor getPlotProcessor(float[] signal, float[] sem, float[] t, float[] stimulus, double ci, float[] mm, java.lang.String name, java.lang.String yText)
          Make a graphic plot processor out of a signal with standard error of the mean sem.
 int[] getRandomPermutedBlock()
          Make a randomized permuted block vector that is used to decide which condition to show.
 java.lang.String getScriptFilename()
           
 float[] getStimulusVector(int length, int lengthCondition, float min, float max)
          Make a square wave 'stimulus vector' i.e.
 java.lang.String getString(int ix)
           
 float[] getWaveform()
           
 int getWidth()
           
protected  void init()
           
protected  ij.process.FloatProcessor[] loadProjectedStimulusMaps(java.lang.String directory, java.lang.String stimulusFile)
          Read projected stimulus maps and return as a FloatProcessor array.
 ij.process.ByteProcessor[] loadStimulusMaps(java.lang.String directory, java.lang.String stimulusFile)
          Create stimulus maps file and return as a ByteProcessor array.
protected  int lookupKeyword(java.lang.String word)
          Lookup the corresponding index for a keyword.
protected  java.lang.String makeValid(java.lang.String s)
           
protected  void parse(java.io.Reader r, java.util.Hashtable dictionary)
          Parse the stream r, looking for parameters in dictionary.
 void process()
          Process the OID files.
protected  float[][] registerFrames(float[][] a, int roiWidth, int roiX, int roiY, java.lang.String name)
          Register frames in a to the first frame in a.
static java.lang.String removeExtension(java.lang.String fileName)
           
 void saveAnalysis(float[][] images, int nrcolumns, java.lang.String functionName, java.lang.String name, boolean doStack)
          Save the analysis in images.
 boolean saveAsTable(float[][] avg, float[][] sem, float[] stim, java.lang.String functionName, java.lang.String name)
          Save the vectors avg, below, above, and x as an Excel compatible, tab separated table.
 boolean saveAsTable(float[] avg, float[] sem, float[] stim, java.lang.String functionName, java.lang.String name)
          Save the vectors avg, below, above, and x as an Excel compatible, tab separated table.
 boolean saveAsTable(float[] avg, java.lang.String functionName, java.lang.String name)
          Save the vectors avg, and x as an Excel compatible, tab separated table.
 boolean saveAsTable(java.lang.StringBuffer sb, java.lang.String functionName, java.lang.String name)
          Save the vectors avg, below, above, and x as an Excel compatible, tab separated table.
protected static void saveFrames(float[][] a, int frameWidth, java.lang.String directory, java.lang.String name)
          Save the aggregated frames.
 boolean saveRegistrationAsTable(float[] x, float[] y, float[] rot, java.lang.String name)
          Save the vectors with the x, y and rotation registration parameters into a Excel readblae separated file.
 void set(int ix, double value)
          Set parameter ix to value value.
 void setAnalyzer(OIDBaseAnalyzer analyzer)
           
 void setRegistration(boolean value)
          Set extra registration flag on or off.
 void setVerbosity(int verbosity)
           
 void showAndSavePlot(float[] tc, float[] sem, float[] minmax, java.lang.String yLabel, java.lang.String functionName, java.lang.String name)
           
 void showAndSavePlots(float[][] tc, float[][] sem, float[] minmax, java.lang.String yLabel, java.lang.String functionName, java.lang.String name, float[][] masks, int useMask)
          Show and save plots of timecourses in tc.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

protected java.lang.String directory
The working directory from which you are analyzing, i.e. where the script is running.

filesDirectory

protected java.lang.String filesDirectory
The directory where the sequence files are located.

scriptFilePath

protected java.lang.String scriptFilePath
The name of the file that controls this OIDFileProcessor.

doExecute

protected boolean doExecute

doRegistration

protected boolean doRegistration

analyzer

protected OIDBaseAnalyzer analyzer

frameWidth

protected int frameWidth

frameHeight

protected int frameHeight

aggregateCounter

protected int aggregateCounter

waveform

protected float[] waveform
May contain waveform of signal. (to fit).

randomblock

protected int[] randomblock
May contain permuted random block for stimulus conditions.

parameters

protected float[] parameters
Contains the parameters that can be set.

parameterStrings

protected java.lang.String[] parameterStrings
Contains the parameters that can be set.

condStrings

protected java.lang.String[] condStrings
Contains the condition names.

dict

protected java.util.Hashtable dict

impAnalysis

protected ij.ImagePlus impAnalysis

directoryResults

public static final java.lang.String directoryResults

verbosity

protected int verbosity

mapfile

protected java.lang.String mapfile

maskfile

protected java.lang.String maskfile

START

public static final int START

END

public static final int END
The last frame at which the stimulus was on, or the end of the stimulus timecourse.

LENGTH

public static final int LENGTH
The number of frames for each condions.

UNIQUECONDS

public static final int UNIQUECONDS

XCENTER

public static final int XCENTER
Approximate position of fovea.

YCENTER

public static final int YCENTER

TIMEFRAME

public static final int TIMEFRAME

HBARWIDTH

public static final int HBARWIDTH

HBARHEIGHT

public static final int HBARHEIGHT

DISTANCEXVERTICAL

public static final int DISTANCEXVERTICAL

DISTANCEYHORIZONTAL

public static final int DISTANCEYHORIZONTAL

DISTANCEXT

public static final int DISTANCEXT

DISTANCEYT

public static final int DISTANCEYT

RUN

public static final int RUN

HSPACING

public static final int HSPACING

HSTART

public static final int HSTART

HN

public static final int HN

VSPACING

public static final int VSPACING

VSTART

public static final int VSTART

VN

public static final int VN

VBARWIDTH

public static final int VBARWIDTH

VBARHEIGHT

public static final int VBARHEIGHT

WAVEFORM

public static final int WAVEFORM

FRAMEWIDTH

public static final int FRAMEWIDTH

FRAMEHEIGHT

public static final int FRAMEHEIGHT

SKIPODDS

public static final int SKIPODDS

CONFIDENCELIMIT

public static final int CONFIDENCELIMIT

STIM_ISOLUMINANCE

public static final int STIM_ISOLUMINANCE

STIM_TYPE

public static final int STIM_TYPE

STIM_IDLE

public static final int STIM_IDLE

STIM_BARWIDTH

public static final int STIM_BARWIDTH

STIM_CHECKERSIZE

public static final int STIM_CHECKERSIZE

STIM_RANDOMBLOCK

public static final int STIM_RANDOMBLOCK

UNIQUECONDSINFILE

public static final int UNIQUECONDSINFILE

AGGREGATESAVE

public static final int AGGREGATESAVE

ANALYZE

public static final int ANALYZE

ANALYZE_PCA

public static final int ANALYZE_PCA

ANALYZE_FIRSTFRAME

public static final int ANALYZE_FIRSTFRAME

ANALYZE_AMPLITUDE

public static final int ANALYZE_AMPLITUDE

ANALYZE_ROI

public static final int ANALYZE_ROI

ANALYZE_ROITC

public static final int ANALYZE_ROITC

ANALYZE_TIMECOURSE

public static final int ANALYZE_TIMECOURSE

ANALYZE_BAG

public static final int ANALYZE_BAG

ANALYZE_REGISTER

public static final int ANALYZE_REGISTER

ANALYZE_REGISTER_ROISIZE

public static final int ANALYZE_REGISTER_ROISIZE

ANALYZE_REGISTER_ROIX

public static final int ANALYZE_REGISTER_ROIX

ANALYZE_REGISTER_ROIY

public static final int ANALYZE_REGISTER_ROIY

ANALYZE_AUTOSCALING

public static final int ANALYZE_AUTOSCALING

ANALYZE_USECOND

public static final int ANALYZE_USECOND

DISPLAY_SCALING

public static final int DISPLAY_SCALING

MASKFILE

public static final int MASKFILE

MASKSCALE

public static final int MASKSCALE

MASKTYPE

public static final int MASKTYPE

MASKTYPE_BARS

public static final int MASKTYPE_BARS

MASKTYPE_T

public static final int MASKTYPE_T

MASKTYPE_PANELS

public static final int MASKTYPE_PANELS

MASKTYPE_CENTRAL

public static final int MASKTYPE_CENTRAL

MASKTYPE_BLOCKS

public static final int MASKTYPE_BLOCKS

MASKFREQUENCY

public static final int MASKFREQUENCY

ANALYZE_FOVEAX

public static final int ANALYZE_FOVEAX

ANALYZE_FOVEAY

public static final int ANALYZE_FOVEAY

ANALYZE_MASKFILE

public static final int ANALYZE_MASKFILE

ANALYZE_START

public static final int ANALYZE_START

ANALYZE_CONDS

public static final int ANALYZE_CONDS

OUTPUTTAG

public static final int OUTPUTTAG

MASKTYPE_DIAG

public static final int MASKTYPE_DIAG
Constructor Detail

ScriptProcessor

public ScriptProcessor(java.lang.String directory,
                       java.lang.String scriptFilePath,
                       OIDBaseAnalyzer analyzer)
Create a new OIDFileProcessor that can call back to an analyzer.
Parameters:
directory - the directory for the control file
scriptFilePath - the control file, see above for format
analyzer - an OIDBaseAnalyzer whose analyze method will be called with every command in the scriptFilePath by default, if scriptFilePath does not contain any analyzer commands.

ScriptProcessor

public ScriptProcessor(java.lang.String directory,
                       java.lang.String scriptFilePath)
Create a new OIDFileProcessor to process the control file. There are no callbacks.
Parameters:
directory - the directory for the control file
scriptFilePath - the control file, see above for format

ScriptProcessor

public ScriptProcessor(java.lang.String directory,
                       java.lang.String scriptFilePath,
                       boolean doExecute)
Create a new OIDFileProcessor to process the control file. There are no callbacks.
Parameters:
directory - the directory for the control file
scriptFilePath - the control file, see above for format
Method Detail

setAnalyzer

public void setAnalyzer(OIDBaseAnalyzer analyzer)

init

protected void init()

get

public float get(java.lang.String name)

get

public float get(int ix)

set

public void set(int ix,
                double value)
Set parameter ix to value value.

setRegistration

public void setRegistration(boolean value)
Set extra registration flag on or off.

getString

public java.lang.String getString(int ix)

getKeyword

public java.lang.String getKeyword(int dictionaryIndex)

getScriptFilename

public java.lang.String getScriptFilename()

getDirectory

public java.lang.String getDirectory()

setVerbosity

public void setVerbosity(int verbosity)

getWidth

public int getWidth()

getHeight

public int getHeight()

getAnalyzeStart

public int getAnalyzeStart()

getMaskName

public java.lang.String getMaskName()

getCondStrings

public java.lang.String[] getCondStrings()

getWaveform

public float[] getWaveform()

process

public void process()
Process the OID files.

parse

protected void parse(java.io.Reader r,
                     java.util.Hashtable dictionary)
              throws java.lang.Exception
Parse the stream r, looking for parameters in dictionary. r should be white space separated.
Parameters:
r - the Reader
dictionary - a hashtable with all valid parameters.

lookupKeyword

protected int lookupKeyword(java.lang.String word)
Lookup the corresponding index for a keyword. If word not in dictionary, returns -1.

makeValid

protected java.lang.String makeValid(java.lang.String s)

saveFrames

protected static void saveFrames(float[][] a,
                                 int frameWidth,
                                 java.lang.String directory,
                                 java.lang.String name)
Save the aggregated frames.

getFrames

public float[][] getFrames(int j,
                           java.lang.String name,
                           java.lang.String directory,
                           ij.ImagePlus imp)
Make a frame array out of the ImagePlus name.

getFrames

protected float[][] getFrames(int i,
                              java.lang.String[] names,
                              java.lang.String directory)
Get a frame array from an array of filenames names, each name pointing to an ImagePlus containing the same number of frames and conditions.
Parameters:
i - the sequence number for names.
names - a number of filenames.
directory - the directory for names.
Returns:
the frames as a float[][].

removeExtension

public static java.lang.String removeExtension(java.lang.String fileName)

aggregateFrames

protected float[][] aggregateFrames(ij.ImagePlus imp,
                                    float[][] a)
Aggregate frames (add in the correct order) in imp into the existing image array a. The image array is copied, and place is reserved for the new frames in imp. The frames in imp are then added in the proper place.
Parameters:
imp - the ImagePlus image containing the new frames.
a - the existing image array. a is NOT modified.
Returns:
the new image array which is a + imp.

aggregateFrames

protected float[][] aggregateFrames(float[][] experiment,
                                    float[][] a)
Aggregate frames (add in the correct order) in experiment into the existing image array a. The image array a is copied, and place is reserved for the new frames in experiment. a will be sorted by condition, if applicable. The frames in experiment are then added in the proper place.
Parameters:
experiment - the the new frames.
a - the existing image array. a is NOT modified.
Returns:
the new image array which is a + experiment.

registerFrames

protected float[][] registerFrames(float[][] a,
                                   int roiWidth,
                                   int roiX,
                                   int roiY,
                                   java.lang.String name)
Register frames in a to the first frame in a. The ROI size are given as a fraction of the width and height in pixels. So for different frame sizes but similar images, the fraction will be the same.
Parameters:
a - the existing image array. a IS modified.
roiWidth - the fractional width of the ROI (as a fraction of total width)
roiX - the x position of the ROI
roiY - the y position of the ROI.
Returns:
a float[][3] with the x, y and rot estimates for each frame.
Throws:
java.lang.IllegalArgumentException -  

saveAnalysis

public void saveAnalysis(float[][] images,
                         int nrcolumns,
                         java.lang.String functionName,
                         java.lang.String name,
                         boolean doStack)
Save the analysis in images. Make an ImagePlus Stack or montage from images, and save as TIFF file.
Parameters:
doStack - if true, save as stack, if false, make a montage and save that.

showAndSavePlots

public void showAndSavePlots(float[][] tc,
                             float[][] sem,
                             float[] minmax,
                             java.lang.String yLabel,
                             java.lang.String functionName,
                             java.lang.String name,
                             float[][] masks,
                             int useMask)
Show and save plots of timecourses in tc. If masks != null, also show masks used in montage.

checkResultsDirectory

protected static void checkResultsDirectory(java.lang.String directory)
Check whether directoryResults exists. If not, create it.

showAndSavePlot

public void showAndSavePlot(float[] tc,
                            float[] sem,
                            float[] minmax,
                            java.lang.String yLabel,
                            java.lang.String functionName,
                            java.lang.String name)

saveAsTable

public boolean saveAsTable(float[] avg,
                           java.lang.String functionName,
                           java.lang.String name)
Save the vectors avg, and x as an Excel compatible, tab separated table. Will contain x values, and y values: avg, lower and upper confidence interval and labeling.

saveAsTable

public boolean saveAsTable(float[] avg,
                           float[] sem,
                           float[] stim,
                           java.lang.String functionName,
                           java.lang.String name)
Save the vectors avg, below, above, and x as an Excel compatible, tab separated table. Will contain x values, and y values: avg, lower and upper confidence interval and labeling.

saveRegistrationAsTable

public boolean saveRegistrationAsTable(float[] x,
                                       float[] y,
                                       float[] rot,
                                       java.lang.String name)
Save the vectors with the x, y and rotation registration parameters into a Excel readblae separated file.

saveAsTable

public boolean saveAsTable(float[][] avg,
                           float[][] sem,
                           float[] stim,
                           java.lang.String functionName,
                           java.lang.String name)
Save the vectors avg, below, above, and x as an Excel compatible, tab separated table. Will contain x values, and y values: avg, lower and upper confidence interval and labeling.

saveAsTable

public boolean saveAsTable(java.lang.StringBuffer sb,
                           java.lang.String functionName,
                           java.lang.String name)
Save the vectors avg, below, above, and x as an Excel compatible, tab separated table. Will contain x values, and y values: avg, lower and upper confidence interval and labeling.

getPlotProcessor

protected ij.process.ImageProcessor getPlotProcessor(float[] signal,
                                                     float[] sem,
                                                     float[] t,
                                                     float[] stimulus,
                                                     double ci,
                                                     float[] mm,
                                                     java.lang.String name,
                                                     java.lang.String yText)
Make a graphic plot processor out of a signal with standard error of the mean sem.
Parameters:
signal - the signal to be plotted.
sem - the standard error of the mean of the signal. If null, not used.
t - is the x-axis (with the proper unit and offset.
ci - is the confidence interval cut off (not used if sem == null).
mm - are the limits you want the signal to be in (mm[0] lower limit, mm[1] upper limit).
name - the name of the plot.
Returns:
an ImageProcessor with the graph.

getStimulusVector

public float[] getStimulusVector(int length,
                                 int lengthCondition,
                                 float min,
                                 float max)
Make a square wave 'stimulus vector' i.e. containing min where the stimulus was of and max where the stimulus was on. Also works for repeat stimuli, where the condition is repeated every lengthCondition frames.
Parameters:
length - the length of the stimulus vector
lengthCondition, - the number of frames in each condition.
start - the frame within a condition when the stimulus is on.
end - the frame within a condition the last when the stimulus was still on.
min - the value for the vector where the stimulus was off.
max - the value where the stimulus was on.
Returns:
a float[] vector containing the square wave.

getRandomPermutedBlock

public int[] getRandomPermutedBlock()
Make a randomized permuted block vector that is used to decide which condition to show.
Returns:
an int[] vector containing the square wave.

loadStimulusMaps

public ij.process.ByteProcessor[] loadStimulusMaps(java.lang.String directory,
                                                   java.lang.String stimulusFile)
Create stimulus maps file and return as a ByteProcessor array. These maps are correct for projection onto the retina as a stimulus. They are projected onto the retina vertically inverted.
Parameters:
directory - the directory where the stimulus maps are
stimulusFile - the name of the file containing the maps.
Returns:
a ByteProcessor array with the stimulus maps.

getFittedMasks

public float[][] getFittedMasks()
Get the requested mask files, used to indicate which pixels on the image belong to which class. There are two possibilities: -1. a stimulus map based mask is used to determine where the classes are and resized to fit the image. The name of the map is in MAPFILE 2. a true analysis mask is used, with 1 for stimulated, -1 for unstimulated, and 0 for all others. The name of the map is in MASKFILE. Load the appropriate mask and fit to the appropriate place and location. Return the masks for the different conditions.
Returns:
a float[][] array containing the correct sized projection masks with for each image pixel a 1,-1, or 0 cf above.

loadProjectedStimulusMaps

protected ij.process.FloatProcessor[] loadProjectedStimulusMaps(java.lang.String directory,
                                                                java.lang.String stimulusFile)
Read projected stimulus maps and return as a FloatProcessor array. These maps correspond to the retinal projection of the stimulus maps obtained with loadStimulusMaps. Expects the fovea to be in the center of the frame. Also take into account the foveal corrections (where the fovea ended up with respect to the center of the image in pixels). The stimulus maps contain the following values: 0 - where stimulus was projected in black flickering to white vv 255 - where stimulus was projected in white flickering to black vv 1 - where no stimulus was projected 2 - where no analysis should be performed (no stimulus projected either). The maps are converted into masks which contain the following values 1 stimulated area -1 non-stimulated area 0 exclude from analysis with a 1 where the stimulus was projected, a -1 where the stimulus was not projected, and a 0 in non-valid areas. These maps are flipped vertically because the retina inverts them vertically with respect to how they look as stimulus, so inferior becomes superior and vice-versa, while left stays left.
Parameters:
directory - the directory where the stimulus maps are
stimulusFile - the name of the file containing the maps.
Returns:
a FloatProcessor array containing the correct projection maps with for each pixel a 1,-1, or 0 cf above.

getFileInfo

protected static ij.io.FileInfo getFileInfo(java.lang.String fileName,
                                            java.lang.String directory,
                                            int width,
                                            int height)
FileInfo raw format object for Dan's format files. width and height should be known, assumes 16 bit format, intel byte order.