fable.python
Class Sample

java.lang.Object
  extended by fable.python.Sample

public class Sample
extends java.lang.Object

Author:
SUCHET

Field Summary
 boolean headersRead
           
 
Constructor Summary
Sample()
           
Sample(java.lang.String path, java.io.File[] files)
           
Sample(java.lang.String experimentName, java.lang.String sampleName)
           
Sample(java.lang.String experimentName, java.lang.String sampleName, java.lang.String path)
           
Sample(java.lang.String experimentName, java.lang.String sampleName, java.lang.String directory, java.io.File[] filesInDir)
           
Sample(java.lang.String experimentName, java.lang.String sampleName, java.lang.String path, java.lang.String[] listFiles)
           
 
Method Summary
 void addCurrentFiles(java.lang.String[] newFiles)
          For preprocessor, to avoid invalid thread access
 boolean addFabioFile(FabioFile _fabioFile)
          30 nov.
 void addFabioFiles(java.lang.String[] newFiles)
           
 void addHeaderValues(java.lang.String key, double[] values)
           
 void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
          Register or remove listeners to sample changes
 void addSampleListener(ISampleListener pl)
           
 void fireSomeHeaderValuesLoaded()
          update plot every 10 files read
 FabioFile getCurrentFabioFile()
           
 java.lang.String getDirectoryName()
          fable.preprocessor fable.preprocessor.process Feb 12, 2007
 java.lang.String getDirectoryPath()
          fable.preprocessor fable.preprocessor.process Feb 14, 2007
 java.util.Vector<FabioFile> getFabioFiles()
          26 sept.
 java.lang.String[] getFabioFilesToProcess(boolean flag)
          Get files to process with the filter and also a good size comparing to the dark and/or the flood
 java.lang.String getFileFormat()
           
 java.lang.String[] getFiles()
           
 java.lang.String getFilter()
           
 java.util.Vector<FabioFile> getFilteredfiles()
          22 Jul 2007
 int getFirst()
           
 double[] getHeaderValues(java.lang.String key)
          used in Header plot
 double[] getHeaderValuesDiff(java.lang.String key)
          used in Header plot
 java.lang.String[] getKeys()
          Get keys for current file
 int getLast()
           
 java.lang.String getName()
           
 java.lang.String getNDigits()
           
 java.lang.String getParentDirectoryName()
          fable.preprocessor fable.preprocessor.process Feb 14, 2007
 java.lang.String getPeaksearchoutStem()
           
 java.util.Vector<FabioFile> getSortedFiles()
          This function is used to sort a vector of fabio files.
 java.lang.String getStem()
          This method init a file serie in python object.
 boolean hasFile()
          26 sept.
 boolean isDirectory()
           
 boolean isShowInNavigator()
          07/08/08 Gaelle since peaksearchSptView is speaking with imageviewer
 boolean isValide()
           
 void removeFabioFile(FabioFile f)
           
 void removeFileAt(int indice)
           
 void removeFiles()
           
 void removePropertyrChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
           
 void removeSampleListener(ISampleListener pl)
           
 void setComparator(java.lang.String Key, int dir)
           
 void setCurrentFile(FabioFile fabio)
           
 void setCurrentFilesFromFabio()
           
 void setDirectory(boolean isDirectory)
           
 void setDirectoryName(java.lang.String name)
          fable.preprocessor fable.preprocessor.process Feb 12, 2007
 void setDirectoryPath(java.lang.String path)
          fable.preprocessor fable.preprocessor.process Feb 14, 2007
 void setFileFormat(java.lang.String format)
           
 void setFiles(java.lang.String[] _files)
           
 void setFilter(java.lang.String s_filter)
           
 void setFirst(int one)
           
 void setlast(int l)
           
 void setNDigits(java.lang.String val)
           
 void setParentDirectoryName(java.lang.String experiment)
          fable.preprocessor fable.preprocessor.process Feb 14, 2007
 void setPeaksearchOutfile(java.lang.String outfile)
           
 void setShowInNavigator(boolean showInNavigator)
          07/08/08 Gaelle since peaksearchSptView is speaking with imageviewer
 void setStem(java.lang.String val)
           
 void setValide(boolean b)
           
 java.lang.String toString()
           
 void updateFabioFiles(java.io.File[] files)
          Update the list of FabioFiles by replacing the current list with the new list of file names.
 void updatefabioFiles(java.lang.String[] newFiles)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

headersRead

public boolean headersRead
Constructor Detail

Sample

public Sample(java.lang.String experimentName,
              java.lang.String sampleName,
              java.lang.String path,
              java.lang.String[] listFiles)
       throws FabioFileException
Throws:
FabioFileException

Sample

public Sample(java.lang.String experimentName,
              java.lang.String sampleName,
              java.lang.String path)

Sample

public Sample(java.lang.String experimentName,
              java.lang.String sampleName)

Sample

public Sample()

Sample

public Sample(java.lang.String path,
              java.io.File[] files)
       throws FabioFileException
Throws:
FabioFileException

Sample

public Sample(java.lang.String experimentName,
              java.lang.String sampleName,
              java.lang.String directory,
              java.io.File[] filesInDir)
       throws FabioFileException
Throws:
FabioFileException
Method Detail

addCurrentFiles

public void addCurrentFiles(java.lang.String[] newFiles)
For preprocessor, to avoid invalid thread access


addFabioFiles

public void addFabioFiles(java.lang.String[] newFiles)
                   throws FabioFileException
Throws:
FabioFileException

updatefabioFiles

public void updatefabioFiles(java.lang.String[] newFiles)
                      throws FabioFileException
Throws:
FabioFileException

addFabioFile

public boolean addFabioFile(FabioFile _fabioFile)
                     throws FabioFileException
30 nov. 07

Parameters:
fileName -
Throws:
FabioFileException - This method adds a fabio file to the vector fabiofiles

getKeys

public java.lang.String[] getKeys()
                           throws SampleException
Get keys for current file

Returns:
Throws:
SampleException

isValide

public boolean isValide()
Returns:
true if sample contains valid values (for example, if all files are ready to be processed with a dark and a flood that has the same dimension as files.

hasFile

public boolean hasFile()
26 sept. 07

Returns:
true if a file has been stored into sample at least

getParentDirectoryName

public java.lang.String getParentDirectoryName()
fable.preprocessor fable.preprocessor.process Feb 14, 2007

Returns:
the _Experiment

setParentDirectoryName

public void setParentDirectoryName(java.lang.String experiment)
fable.preprocessor fable.preprocessor.process Feb 14, 2007

Parameters:
experiment - the _Experiment to set

getDirectoryName

public java.lang.String getDirectoryName()
fable.preprocessor fable.preprocessor.process Feb 12, 2007

Returns:
the _name

setDirectoryName

public void setDirectoryName(java.lang.String name)
fable.preprocessor fable.preprocessor.process Feb 12, 2007

Parameters:
directoryName -

getDirectoryPath

public java.lang.String getDirectoryPath()
fable.preprocessor fable.preprocessor.process Feb 14, 2007

Returns:
the directoryPath

setDirectoryPath

public void setDirectoryPath(java.lang.String path)
fable.preprocessor fable.preprocessor.process Feb 14, 2007

Parameters:
path - the directoryPath to set

toString

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

getFabioFilesToProcess

public java.lang.String[] getFabioFilesToProcess(boolean flag)
Get files to process with the filter and also a good size comparing to the dark and/or the flood

Parameters:
flag -
Returns:

getFiles

public java.lang.String[] getFiles()
Returns:
A Tab with the names of the current files to process

setFiles

public void setFiles(java.lang.String[] _files)
Parameters:
_files - the current files to set. Warning : no fabio files loaded

setCurrentFilesFromFabio

public void setCurrentFilesFromFabio()
Parameters:
_files - the current files to set. Warning : no fabio files loaded

getFabioFiles

public java.util.Vector<FabioFile> getFabioFiles()
26 sept. 07

Returns:
a vector containing all edf files object

getFilteredfiles

public java.util.Vector<FabioFile> getFilteredfiles()
22 Jul 2007

Returns:
a vector containing filtered files

setComparator

public void setComparator(java.lang.String Key,
                          int dir)

getSortedFiles

public java.util.Vector<FabioFile> getSortedFiles()
This function is used to sort a vector of fabio files.

Returns:
a sorted vector of fabio files

addPropertyChangeListener

public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Register or remove listeners to sample changes


removePropertyrChangeListener

public void removePropertyrChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)

removeFiles

public void removeFiles()

removeFileAt

public void removeFileAt(int indice)

removeFabioFile

public void removeFabioFile(FabioFile f)

setFilter

public void setFilter(java.lang.String s_filter)

fireSomeHeaderValuesLoaded

public void fireSomeHeaderValuesLoaded()
update plot every 10 files read


addSampleListener

public void addSampleListener(ISampleListener pl)

removeSampleListener

public void removeSampleListener(ISampleListener pl)

getName

public java.lang.String getName()
Returns:
stem of sample

getFirst

public int getFirst()
Returns:
the number of the first file
Throws:
FabioFileException
FabioFileException

setFirst

public void setFirst(int one)

setlast

public void setlast(int l)

getLast

public int getLast()

getFileFormat

public java.lang.String getFileFormat()
Returns:
the number of the last file
Throws:
FabioFileException

setFileFormat

public void setFileFormat(java.lang.String format)

setNDigits

public void setNDigits(java.lang.String val)

getNDigits

public java.lang.String getNDigits()

setPeaksearchOutfile

public void setPeaksearchOutfile(java.lang.String outfile)

getPeaksearchoutStem

public java.lang.String getPeaksearchoutStem()

getHeaderValues

public double[] getHeaderValues(java.lang.String key)
                         throws SampleException
used in Header plot

Parameters:
key - header key with number values. Except for the date.
Returns:
double[] all double values for this key for all fabio files in this sample
Throws:
SampleException

addHeaderValues

public void addHeaderValues(java.lang.String key,
                            double[] values)

getHeaderValuesDiff

public double[] getHeaderValuesDiff(java.lang.String key)
                             throws SampleException
used in Header plot

Parameters:
key - header key
Returns:
double[] all double values for this key for all fabio files in this sample
Throws:
SampleException

setCurrentFile

public void setCurrentFile(FabioFile fabio)

getCurrentFabioFile

public FabioFile getCurrentFabioFile()

isDirectory

public boolean isDirectory()
Returns:
true if files have been set to this sampl by selecting a directory.

setDirectory

public void setDirectory(boolean isDirectory)
Parameters:
isDirectory - true if files have been loaded from a folder. False if files have been selected from files menu.

getFilter

public java.lang.String getFilter()

isShowInNavigator

public boolean isShowInNavigator()
07/08/08 Gaelle since peaksearchSptView is speaking with imageviewer

Returns:
true if this sample must be shown in the navigator

setShowInNavigator

public void setShowInNavigator(boolean showInNavigator)
07/08/08 Gaelle since peaksearchSptView is speaking with imageviewer

Parameters:
showInNavigator - true if sample must be shown in sample navigator

setValide

public void setValide(boolean b)

getStem

public java.lang.String getStem()
This method init a file serie in python object. It is based on filteredfabio file.

Returns:
the stem taken from python code.

updateFabioFiles

public void updateFabioFiles(java.io.File[] files)
                      throws FabioFileException
Update the list of FabioFiles by replacing the current list with the new list of file names. For efficiency reasons reuse the existing FabioFile if exists in the old list.

Parameters:
Files - [] files - new list of files to replace existing list in Sample
Throws:
FabioFileException

setStem

public void setStem(java.lang.String val)
Parameters:
val - the stem to set to this file serie