#include <parameterxmlmodifier.h>
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. |
bool ParameterXmlModifier::parseFile | ( | const KURL & | url | ) |
Opens and parses the file with the url
.
url | url of the file to open. |
bool ParameterXmlModifier::writeTofile | ( | const KURL & | url | ) |
Writes the modified xml tree to a parameter file given by url
.
url | url of the file to write to. |
QDomNode ParameterXmlModifier::findDirectChild | ( | QString | childName | ) |
Finds the first child node with the tag name childName
direct child of the root node.
childName | name of the child node tag to look up. |
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.
childName | name of thechild node tag to look up. | |
ancestor | starting node from which to look up for the node. |
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
.
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. |
bool ParameterXmlModifier::setAcquisitionSystemInformation | ( | int | resolution, | |
int | nbChannels, | |||
double | samplingRate, | |||
int | voltageRange, | |||
int | amplification, | |||
int | offset | |||
) |
Modifies the elements related to the acquisition system.
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. |
bool ParameterXmlModifier::setLfpInformation | ( | double | lfpSamplingRate | ) |
Modifies the element related to the field potentials.
lfpSamplingRate | local field potential sampling rate in hertz. |
void ParameterXmlModifier::setMiscellaneousInformation | ( | float | screenGain, | |
QString | traceBackgroungImage | |||
) |
Creates the elements containing NeuroScope miscellaneous information.
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.
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.
width | video image width. | |
height | video image height. |
bool ParameterXmlModifier::setChannelDisplayInformation | ( | ChannelColors * | channelColors, | |
QMap< int, int > & | channelsGroups, | |||
QMap< int, int > & | channelDefaultOffsets | |||
) |
Modifies the elements related to the channels display.
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. |
bool ParameterXmlModifier::setAnatomicalDescription | ( | QMap< int, QValueList< int > > & | anatomicalGroups, | |
QMap< int, bool > | skipStatus | |||
) |
Modifies the elements related to the anatomical description.
anatomicalGroups | map given to which anatomical group each channel belongs. | |
skipStatus | map given the skip status of the channels. |
bool ParameterXmlModifier::setSpikeDetectionInformation | ( | int | nbSamples, | |
int | peakSampleIndex, | |||
QMap< int, QValueList< int > > & | spikeGroups | |||
) |
Modifies the elements related to the spike detection.
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. |
bool ParameterXmlModifier::setSpikeDetectionInformation | ( | QMap< int, QValueList< int > > & | spikeGroups | ) |
Modifies the elements related to the spike detection.
spikeGroups | map given to which spike group each channel belongs. |
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.
extensionSamplingRates | map between file extension and the sampling rate. |
bool ParameterXmlModifier::parseFile | ( | const KURL & | url | ) |
Opens and parses the file with the url
.
url | url of the file to open. |
bool ParameterXmlModifier::writeTofile | ( | const KURL & | url | ) |
Writes the modified xml tree to a parameter file given by url
.
url | url of the file to write to. |
QDomNode ParameterXmlModifier::findDirectChild | ( | QString | childName | ) |
Finds the first child node with the tag name childName
direct child of the root node.
childName | name of the child node tag to look up. |
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.
childName | name of thechild node tag to look up. | |
ancestor | starting node from which to look up for the node. |
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
.
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. |
bool ParameterXmlModifier::setAcquisitionSystemInformation | ( | int | resolution, | |
int | nbChannels, | |||
double | samplingRate, | |||
int | voltageRange, | |||
int | amplification, | |||
int | offset | |||
) |
Modifies the elements related to the acquisition system.
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. |
bool ParameterXmlModifier::setLfpInformation | ( | double | lfpSamplingRate | ) |
Modifies the element related to the field potentials.
lfpSamplingRate | local field potential sampling rate in hertz. |
void ParameterXmlModifier::setMiscellaneousInformation | ( | float | screenGain, | |
QString | traceBackgroungImage | |||
) |
Creates the elements containing NeuroScope miscellaneous information.
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.
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.
width | video image width. | |
height | video image height. |
bool ParameterXmlModifier::setChannelDisplayInformation | ( | ChannelColors * | channelColors, | |
QMap< int, int > & | channelsGroups, | |||
QMap< int, int > & | channelDefaultOffsets | |||
) |
Modifies the elements related to the channels display.
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. |
bool ParameterXmlModifier::setAnatomicalDescription | ( | QMap< int, QValueList< int > > & | anatomicalGroups, | |
QMap< int, bool > | skipStatus | |||
) |
Modifies the elements related to the anatomical description.
anatomicalGroups | map given to which anatomical group each channel belongs. | |
skipStatus | map given the skip status of the channels. |
bool ParameterXmlModifier::setSpikeDetectionInformation | ( | int | nbSamples, | |
int | peakSampleIndex, | |||
QMap< int, QValueList< int > > & | spikeGroups | |||
) |
Modifies the elements related to the spike detection.
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. |
bool ParameterXmlModifier::setSpikeDetectionInformation | ( | QMap< int, QValueList< int > > & | spikeGroups | ) |
Modifies the elements related to the spike detection.
spikeGroups | map given to which spike group each channel belongs. |
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.
extensionSamplingRates | map between file extension and the sampling rate. |