retina
Class OIDroiTCAnalyzer

java.lang.Object
  |
  +--retina.OIDroiAnalyzer
        |
        +--retina.OIDroiTCAnalyzer
All Implemented Interfaces:
OIDBaseAnalyzer

public class OIDroiTCAnalyzer
extends OIDroiAnalyzer

Does ROI analysis of OID files and looks for timecourse of all different possible stimuli. Uses the shape of the stimulus to find the timecourse of the signal, if any. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Fields inherited from class retina.OIDroiAnalyzer
controlMasks, functionName, scriptProcessor, stimulusMasks
 
Constructor Summary
OIDroiTCAnalyzer()
           
OIDroiTCAnalyzer(ScriptProcessor scriptProcessor)
           
 
Method Summary
 void analyze(float[][] a, int width, java.lang.String directory, java.lang.String name)
          Analyze a series of OID frames a.
protected static ij.process.ImageProcessor getPlotProcessor(float[] signal, float[] sem, float[] t, float ci, float[] mm, java.lang.String name)
          Make a graphic plot processor out of a signal with standard error of the mean sem.
 void makeMasks(java.lang.String directory, boolean show)
          Make ROI masks.
protected static void mapCorrelations(float[][][] signal, float[][][] sem, java.lang.String directory, java.lang.String name)
           
 void printInfo()
           
protected static boolean saveAsTable(java.lang.String path, float[][][] signal, float[][][] sem, float[] stim, float[] t)
          Save the 3-d matrices avg and sem in the following Excel compatible format.
protected static void showAndSaveResults(java.lang.String functionName, double[][][] avgd, double[][][] semd, java.lang.String directory, java.lang.String name)
          Plot all signals for each condition and ROI, with their CI.
protected static void statsROIBaselineCondition(double[][][] signal, double[][][] sem, float[][] a, int j, int k, int l, int length, int nrUniqueConditions, int nrConditionsPerUniqueCondition, int baselineCondition)
          Compute signal and SEM for all ROIs for the frame of condition j, frame k.
protected static void statsROIPrestimulusAverage(double[][][] signal, double[][][] sem, float[][] a, int j, int k, int l, int length, int nrConditionsPerUniqueCondition, float[] averageBaseline)
          Compute signal and SEM for all ROIs for the frame of condition j, frame k.
protected static void statsROISameImage(double[][][] signal, double[][][] sem, float[][] a, int j, int k, int l, int length, int nrConditionsPerUniqueCondition, boolean division)
          Compute signal and SEM for all ROIs for the frame of condition j, frame k.
 java.lang.String toString()
           
 
Methods inherited from class retina.OIDroiAnalyzer
analyze, division, exit, init, init, invertMask, makeBarMasks, makeDiagonalControlMask, makeDiagonalMask, makeDiagonalMasks, makeHorizontalControlMask, makeHorizontalHalfMask, makeHorizontalMask, makeTControlMask, makeTMask, makeTMasks, makeVerticalControlMask, makeVerticalHalfMask, makeVerticalMask, prefersRegistration, showAndSaveResults, stats
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OIDroiTCAnalyzer

public OIDroiTCAnalyzer()

OIDroiTCAnalyzer

public OIDroiTCAnalyzer(ScriptProcessor scriptProcessor)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class OIDroiAnalyzer

analyze

public void analyze(float[][] a,
                    int width,
                    java.lang.String directory,
                    java.lang.String name)
Analyze a series of OID frames a. Calculate the timecourses for all different rois for each unique condition. There are horizontal and vertical rois and also control rois.
Parameters:
a - the series of frames.
width - the width in pixels of the frames in a
directory - the directory where the files should go.
name - the name(s) of the file(s) on which is based

statsROIBaselineCondition

protected static void statsROIBaselineCondition(double[][][] signal,
                                                double[][][] sem,
                                                float[][] a,
                                                int j,
                                                int k,
                                                int l,
                                                int length,
                                                int nrUniqueConditions,
                                                int nrConditionsPerUniqueCondition,
                                                int baselineCondition)
Compute signal and SEM for all ROIs for the frame of condition j, frame k. Divide the average of a ROI by the average over a control ROI from the baseline (no stimulus condition). So the obtained signal is relative to the total stimulus reflectance change of the given baseline condition. Aggregate into signal and sem (Standard Error of the Mean) arrays.
Parameters:
signal - a double [][][] for the signals
sem - a double [][][] for the SEMs
a - the float[][] with the OID frames
j - the current unique condition
k - the current frame
l - the current condition of this unique condition.
k - the current frame within the non-unqiue condition.
length - the length of each frame
nrConditionsPerUniqueCondition -  
baselineCondition - the index of the baseline condition you want to divide by.

statsROIPrestimulusAverage

protected static void statsROIPrestimulusAverage(double[][][] signal,
                                                 double[][][] sem,
                                                 float[][] a,
                                                 int j,
                                                 int k,
                                                 int l,
                                                 int length,
                                                 int nrConditionsPerUniqueCondition,
                                                 float[] averageBaseline)
Compute signal and SEM for all ROIs for the frame of condition j, frame k. The obtained signal is relative to the average background reflectance of the baseline (prestimulus average). Divide the average of a ROI by the average over the same ROI of the average baseline frame. Aggregate into signal and sem (Standard Error of the Mean) arrays.
Parameters:
signal - a double [][][] for the signals
sem - a double [][][] for the SEMs
a - the float[][] with the OID frames
j - the current unique condition
k - the current frame
l - the current condition of this unique condition.
k - the current frame within the non-unqiue condition.
length - the length of each frame
nrConditionsPerUniqueCondition -  
division - indicates whether to division (true) or subtraction (false).

statsROISameImage

protected static void statsROISameImage(double[][][] signal,
                                        double[][][] sem,
                                        float[][] a,
                                        int j,
                                        int k,
                                        int l,
                                        int length,
                                        int nrConditionsPerUniqueCondition,
                                        boolean division)
Compute signal and SEM for all ROIs for the frame of condition j, frame k. Divide the average of a ROI by the average over a background ROI in the same frame. So the obtained signal is relative to the average background reflectance Aggregate into signal and sem (Standard Error of the Mean) arrays.
Parameters:
signal - a double [][][] for the signals
sem - a double [][][] for the SEMs
a - the float[][] with the OID frames
j - the current condition
k - the current frame
length - the length of each frame
nrConditionsPerUniqueCondition -  
division - indicates whether to division (true) or subtraction (false).

printInfo

public void printInfo()
Overrides:
printInfo in class OIDroiAnalyzer

showAndSaveResults

protected static void showAndSaveResults(java.lang.String functionName,
                                         double[][][] avgd,
                                         double[][][] semd,
                                         java.lang.String directory,
                                         java.lang.String name)
Plot all signals for each condition and ROI, with their CI. Show the plot and save as JPEG files.
Parameters:
signal - a double[][][] matrix with a bunch of column vectors with averages to be plotted.
sem - a double[][] matrix with a bunch of column vectors with stddevs of avg.
directory - the directory to save to.
name - a String with the name of the vectors being plotted.

mapCorrelations

protected static void mapCorrelations(float[][][] signal,
                                      float[][][] sem,
                                      java.lang.String directory,
                                      java.lang.String name)

getPlotProcessor

protected static ij.process.ImageProcessor getPlotProcessor(float[] signal,
                                                            float[] sem,
                                                            float[] t,
                                                            float ci,
                                                            float[] mm,
                                                            java.lang.String name)
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.

saveAsTable

protected static boolean saveAsTable(java.lang.String path,
                                     float[][][] signal,
                                     float[][][] sem,
                                     float[] stim,
                                     float[] t)
Save the 3-d matrices avg and sem in the following Excel compatible format.
Parameters:
signal - the signal
sem - the standard error of the mean
stim - the stimulus status
t - the timestamp Format:
 t    stim   cond 0                                                              1...
             roi  0             1              2           3  4  5  ....         0  1  2  3..
                      ....
 

makeMasks

public void makeMasks(java.lang.String directory,
                      boolean show)
Make ROI masks. Required parameters. xCenter, yCenter where the projection of the stimulus is centered.
Overrides:
makeMasks in class OIDroiAnalyzer