Ejemplo n.º 1
0
        public static EegElectrodeCollection?Collect(BrainVisionPackage filesContent)
        {
            IHeaderFileContentVer1 headerContent    = filesContent.HeaderFileContent;
            List <Coordinates>?    inputCoordinates = headerContent.GetChannelCoordinates();

            if (inputCoordinates == null)
            {
                return(null);
            }

            List <ChannelInfo>?inputChannels = headerContent.GetChannelInfos();
            int inputChannelsCount           = inputChannels == null ? 0 : inputChannels.Count;

            EegElectrodeCollection eegElectrodes = new EegElectrodeCollection();

            for (int channelNumber = 0; channelNumber < inputCoordinates.Count; ++channelNumber)
            {
                Coordinates coordinates = inputCoordinates[channelNumber];

                (double cartesianX, double cartesianY, double cartesianZ) = SphericalToCartesian(coordinates);

                EegElectrode eegElectrode = new EegElectrode(
                    //REQUIRED
                    name: channelNumber < inputChannelsCount ? inputChannels ![channelNumber].Name : string.Empty,
Ejemplo n.º 2
0
 public static void SaveEegElectrodesFile(string filePath, EegElectrodeCollection electrodes)
 {
     Directory.CreateDirectory(Path.GetDirectoryName(filePath));
     EegElectrodesWriter.Save(filePath, electrodes);
 }
Ejemplo n.º 3
0
 public static void SaveEegElectrodesFile(string filePath, EegElectrodeCollection electrodes)
 => EegModalityFolder.SaveEegElectrodesFile(filePath, electrodes);
Ejemplo n.º 4
0
 public void SaveEegElectrodesFile(EegElectrodeCollection electrodes)
 => SaveEegElectrodesFile(EegElectrodesFilePath, electrodes);
Ejemplo n.º 5
0
        public static void Save(string filePath, EegElectrodeCollection electrodes)
        {
            List <EegElectrodeTsv> list = electrodes.ConvertAll(p => new EegElectrodeTsv(p));

            TsvTableWriter <EegElectrodeTsv> .Save(filePath, EegElectrodeTsv.TsvIdentifiers, list);
        }