ParameterXmlModifier Class Reference

Class modifying the parameter xml file. More...

#include <parameterxmlmodifier.h>

List of all members.

Public Member Functions

 ParameterXmlModifier ()
 Constructor.
bool parseFile (const KURL &url)
 Opens and parses the file with the url.
bool writeTofile (const KURL &url)
 Writes the modified xml tree to a parameter file given by url.
QDomNode findDirectChild (QString childName)
 Finds the first child node with the tag name childName direct child of the root node.
QDomNode findDirectChild (QString childName, QDomNode ancestor)
 Finds the first child node with the tag name childName direct child of the ancestor node.
QDomNode findDirectChild (QString childName, QString grandChildName, QString value, QDomNode ancestor)
 Finds the first child node with the tag name childName direct child of the ancestor node.
bool setAcquisitionSystemInformation (int resolution, int nbChannels, double samplingRate, int voltageRange, int amplification, int offset)
 Modifies the elements related to the acquisition system.
bool setLfpInformation (double lfpSamplingRate)
 Modifies the element related to the field potentials.
void setMiscellaneousInformation (float screenGain, QString traceBackgroungImage)
 Creates the elements containing NeuroScope miscellaneous information.
void setNeuroscopeVideoInformation (int rotation, int flip, QString backgroundPath, int drawTrajectory)
 Creates the elements containing the video information of the neuroscope element.
bool setVideoInformation (int width, int height)
 Modifies the elements containing the video information.
bool setChannelDisplayInformation (ChannelColors *channelColors, QMap< int, int > &channelsGroups, QMap< int, int > &channelDefaultOffsets)
 Modifies the elements related to the channels display.
bool setAnatomicalDescription (QMap< int, QValueList< int > > &anatomicalGroups, QMap< int, bool > skipStatus)
 Modifies the elements related to the anatomical description.
bool setSpikeDetectionInformation (int nbSamples, int peakSampleIndex, QMap< int, QValueList< int > > &spikeGroups)
 Modifies the elements related to the spike detection.
bool setSpikeDetectionInformation (QMap< int, QValueList< int > > &spikeGroups)
 Modifies the elements related to the spike detection.
bool setSampleRateByExtension (QMap< QString, double > extensionSamplingRates)
 A base file name can be used for different kind of files corresponding to the same data and having different sampling rates.
 ParameterXmlModifier ()
 Constructor.
bool parseFile (const KURL &url)
 Opens and parses the file with the url.
bool writeTofile (const KURL &url)
 Writes the modified xml tree to a parameter file given by url.
QDomNode findDirectChild (QString childName)
 Finds the first child node with the tag name childName direct child of the root node.
QDomNode findDirectChild (QString childName, QDomNode ancestor)
 Finds the first child node with the tag name childName direct child of the ancestor node.
QDomNode findDirectChild (QString childName, QString grandChildName, QString value, QDomNode ancestor)
 Finds the first child node with the tag name childName direct child of the ancestor node.
bool setAcquisitionSystemInformation (int resolution, int nbChannels, double samplingRate, int voltageRange, int amplification, int offset)
 Modifies the elements related to the acquisition system.
bool setLfpInformation (double lfpSamplingRate)
 Modifies the element related to the field potentials.
void setMiscellaneousInformation (float screenGain, QString traceBackgroungImage)
 Creates the elements containing NeuroScope miscellaneous information.
void setNeuroscopeVideoInformation (int rotation, int flip, QString backgroundPath, int drawTrajectory)
 Creates the elements containing the video information of the neuroscope element.
bool setVideoInformation (int width, int height)
 Modifies the elements containing the video information.
bool setChannelDisplayInformation (ChannelColors *channelColors, QMap< int, int > &channelsGroups, QMap< int, int > &channelDefaultOffsets)
 Modifies the elements related to the channels display.
bool setAnatomicalDescription (QMap< int, QValueList< int > > &anatomicalGroups, QMap< int, bool > skipStatus)
 Modifies the elements related to the anatomical description.
bool setSpikeDetectionInformation (int nbSamples, int peakSampleIndex, QMap< int, QValueList< int > > &spikeGroups)
 Modifies the elements related to the spike detection.
bool setSpikeDetectionInformation (QMap< int, QValueList< int > > &spikeGroups)
 Modifies the elements related to the spike detection.
bool setSampleRateByExtension (QMap< QString, double > extensionSamplingRates)
 A base file name can be used for different kind of files corresponding to the same data and having different sampling rates.


Detailed Description

Class modifying the parameter xml file.

Author:
Lynn Hazan


Member Function Documentation

bool ParameterXmlModifier::parseFile ( const KURL &  url  ) 

Opens and parses the file with the url.

Parameters:
url url of the file to open.
Returns:
true if the file was correctly parse, false othewise.

bool ParameterXmlModifier::writeTofile ( const KURL &  url  ) 

Writes the modified xml tree to a parameter file given by url.

Parameters:
url url of the file to write to.
Returns:
true if the parameter file could be write to disk, false otherwise.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName  ) 

Finds the first child node with the tag name childName direct child of the root node.

Parameters:
childName name of the child node tag to look up.
Returns:
the first node starting from root having tagName as tag name.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName,
QDomNode  ancestor 
)

Finds the first child node with the tag name childName direct child of the ancestor node.

Parameters:
childName name of thechild node tag to look up.
ancestor starting node from which to look up for the node.
Returns:
the first node starting from ancestor having tagName as tag name.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName,
QString  grandChildName,
QString  value,
QDomNode  ancestor 
)

Finds the first child node with the tag name childName direct child of the ancestor node.

This node has to contain a direct child node with the tag name grandChildName with a text value of value.

Parameters:
childName name of the child node tag to look up.
grandChildName name of the grandchild node tag to look up.
value value of the textNode contained in grandChildName.
ancestor starting node from which to look up for the child node.
Returns:
the first child node corresponding to the criteria.

bool ParameterXmlModifier::setAcquisitionSystemInformation ( int  resolution,
int  nbChannels,
double  samplingRate,
int  voltageRange,
int  amplification,
int  offset 
)

Modifies the elements related to the acquisition system.

Parameters:
resolution resolution of the system in bits.
nbChannels number of channels.
samplingRate the sampling rate in hertz.
voltageRange voltage range of the acquisition system in volts.oltage range of the acquisition system in volts.
amplification amplification of the acquisition system.
offset initial offset for all the traces.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setLfpInformation ( double  lfpSamplingRate  ) 

Modifies the element related to the field potentials.

Parameters:
lfpSamplingRate local field potential sampling rate in hertz.
Returns:
true if the modification succeded, false otherwise.

void ParameterXmlModifier::setMiscellaneousInformation ( float  screenGain,
QString  traceBackgroungImage 
)

Creates the elements containing NeuroScope miscellaneous information.

Parameters:
screenGain screen gain in milivolts by centimeters used to display the field potentiels.
traceBackgroungImage image used as background for the trace view.

void ParameterXmlModifier::setNeuroscopeVideoInformation ( int  rotation,
int  flip,
QString  backgroundPath,
int  drawTrajectory 
)

Creates the elements containing the video information of the neuroscope element.

Parameters:
rotation video image rotation angle.
flip video image flip orientation, 0 stands for none, 1 for vertical and 2 for horizontal.
backgroundPath path of the background image.
drawTrajectory all the positions contained in a position file can be used to create a background image for the PositionView. This value tells if such background has to be created.

bool ParameterXmlModifier::setVideoInformation ( int  width,
int  height 
)

Modifies the elements containing the video information.

Parameters:
width video image width.
height video image height.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setChannelDisplayInformation ( ChannelColors channelColors,
QMap< int, int > &  channelsGroups,
QMap< int, int > &  channelDefaultOffsets 
)

Modifies the elements related to the channels display.

Parameters:
channelColors list of colors for the channels (color use to display the channel, color of the anatomical group to which the channel belongs, color of the spike group to which the channel belongs).
channelsGroups map given to which group each channel belongs.
channelDefaultOffsets map given the default channel offsets.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setAnatomicalDescription ( QMap< int, QValueList< int > > &  anatomicalGroups,
QMap< int, bool >  skipStatus 
)

Modifies the elements related to the anatomical description.

Parameters:
anatomicalGroups map given to which anatomical group each channel belongs.
skipStatus map given the skip status of the channels.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSpikeDetectionInformation ( int  nbSamples,
int  peakSampleIndex,
QMap< int, QValueList< int > > &  spikeGroups 
)

Modifies the elements related to the spike detection.

Parameters:
nbSamples number of samples in a spike.
peakSampleIndex sample index corresponding to the peak of the spike.
spikeGroups map given to which spike group each channel belongs.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSpikeDetectionInformation ( QMap< int, QValueList< int > > &  spikeGroups  ) 

Modifies the elements related to the spike detection.

Parameters:
spikeGroups map given to which spike group each channel belongs.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSampleRateByExtension ( QMap< QString, double >  extensionSamplingRates  ) 

A base file name can be used for different kind of files corresponding to the same data and having different sampling rates.

Each file is identified by its extension. this function modifies the elements related to the mapping between the file extensions with the sampling rates for the current document. This map does not includes the sampling rates for the extension dat and eeg, they are treated separately.

Parameters:
extensionSamplingRates map between file extension and the sampling rate.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::parseFile ( const KURL &  url  ) 

Opens and parses the file with the url.

Parameters:
url url of the file to open.
Returns:
true if the file was correctly parse, false othewise.

bool ParameterXmlModifier::writeTofile ( const KURL &  url  ) 

Writes the modified xml tree to a parameter file given by url.

Parameters:
url url of the file to write to.
Returns:
true if the parameter file could be write to disk, false otherwise.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName  ) 

Finds the first child node with the tag name childName direct child of the root node.

Parameters:
childName name of the child node tag to look up.
Returns:
the first node starting from root having tagName as tag name.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName,
QDomNode  ancestor 
)

Finds the first child node with the tag name childName direct child of the ancestor node.

Parameters:
childName name of thechild node tag to look up.
ancestor starting node from which to look up for the node.
Returns:
the first node starting from ancestor having tagName as tag name.

QDomNode ParameterXmlModifier::findDirectChild ( QString  childName,
QString  grandChildName,
QString  value,
QDomNode  ancestor 
)

Finds the first child node with the tag name childName direct child of the ancestor node.

This node has to contain a direct child node with the tag name grandChildName with a text value of value.

Parameters:
childName name of the child node tag to look up.
grandChildName name of the grandchild node tag to look up.
value value of the textNode contained in grandChildName.
ancestor starting node from which to look up for the child node.
Returns:
the first child node corresponding to the criteria.

bool ParameterXmlModifier::setAcquisitionSystemInformation ( int  resolution,
int  nbChannels,
double  samplingRate,
int  voltageRange,
int  amplification,
int  offset 
)

Modifies the elements related to the acquisition system.

Parameters:
resolution resolution of the system in bits.
nbChannels number of channels.
samplingRate the sampling rate in hertz.
voltageRange voltage range of the acquisition system in volts.oltage range of the acquisition system in volts.
amplification amplification of the acquisition system.
offset initial offset for all the traces.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setLfpInformation ( double  lfpSamplingRate  ) 

Modifies the element related to the field potentials.

Parameters:
lfpSamplingRate local field potential sampling rate in hertz.
Returns:
true if the modification succeded, false otherwise.

void ParameterXmlModifier::setMiscellaneousInformation ( float  screenGain,
QString  traceBackgroungImage 
)

Creates the elements containing NeuroScope miscellaneous information.

Parameters:
screenGain screen gain in milivolts by centimeters used to display the field potentiels.
traceBackgroungImage image used as background for the trace view.

void ParameterXmlModifier::setNeuroscopeVideoInformation ( int  rotation,
int  flip,
QString  backgroundPath,
int  drawTrajectory 
)

Creates the elements containing the video information of the neuroscope element.

Parameters:
rotation video image rotation angle.
flip video image flip orientation, 0 stands for none, 1 for vertical and 2 for horizontal.
backgroundPath path of the background image.
drawTrajectory all the positions contained in a position file can be used to create a background image for the PositionView. This value tells if such background has to be created.

bool ParameterXmlModifier::setVideoInformation ( int  width,
int  height 
)

Modifies the elements containing the video information.

Parameters:
width video image width.
height video image height.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setChannelDisplayInformation ( ChannelColors channelColors,
QMap< int, int > &  channelsGroups,
QMap< int, int > &  channelDefaultOffsets 
)

Modifies the elements related to the channels display.

Parameters:
channelColors list of colors for the channels (color use to display the channel, color of the anatomical group to which the channel belongs, color of the spike group to which the channel belongs).
channelsGroups map given to which group each channel belongs.
channelDefaultOffsets map given the default channel offsets.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setAnatomicalDescription ( QMap< int, QValueList< int > > &  anatomicalGroups,
QMap< int, bool >  skipStatus 
)

Modifies the elements related to the anatomical description.

Parameters:
anatomicalGroups map given to which anatomical group each channel belongs.
skipStatus map given the skip status of the channels.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSpikeDetectionInformation ( int  nbSamples,
int  peakSampleIndex,
QMap< int, QValueList< int > > &  spikeGroups 
)

Modifies the elements related to the spike detection.

Parameters:
nbSamples number of samples in a spike.
peakSampleIndex sample index corresponding to the peak of the spike.
spikeGroups map given to which spike group each channel belongs.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSpikeDetectionInformation ( QMap< int, QValueList< int > > &  spikeGroups  ) 

Modifies the elements related to the spike detection.

Parameters:
spikeGroups map given to which spike group each channel belongs.
Returns:
true if the modification succeded, false otherwise.

bool ParameterXmlModifier::setSampleRateByExtension ( QMap< QString, double >  extensionSamplingRates  ) 

A base file name can be used for different kind of files corresponding to the same data and having different sampling rates.

Each file is identified by its extension. this function modifies the elements related to the mapping between the file extensions with the sampling rates for the current document. This map does not includes the sampling rates for the extension dat and eeg, they are treated separately.

Parameters:
extensionSamplingRates map between file extension and the sampling rate.
Returns:
true if the modification succeded, false otherwise.


The documentation for this class was generated from the following files:
Generated on Mon Sep 17 20:47:34 2007 for NeuroScope by  doxygen 1.5.1