Esempio n. 1
0
        public static EegChannelCollection?Collect(BrainVisionPackage filesContent)
        {
            IHeaderFileContentVer1 headerContent = filesContent.HeaderFileContent;
            List <ChannelInfo>?    inputChannels = headerContent.GetChannelInfos();

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

            double samplingFrequency = Common.GetSamplingFrequencyFromSamplingInterval(headerContent.SamplingInterval !.Value);

            EegChannelCollection eegChannels = new EegChannelCollection();

            foreach (ChannelInfo inputChannel in inputChannels)
            {
                PrefixedUnit?channelUnits = Common.ConvertTextToPrefixedUnit(inputChannel.Unit);
                if (channelUnits == null)
                {
                    throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, Resources.UrecognizedUnitExceptionMessage, inputChannel.Unit, inputChannel.Name));
                }

                EegChannel eegChannel = new EegChannel(
                    //REQUIRED
                    name: inputChannel.Name,
                    type: ChannelType.EEG,
                    units: channelUnits.Value)
                {
                    //OPTIONAL
                    SamplingFrequency = samplingFrequency,
                    //Reference = null,
                    //LowCutoff = null,
                    //HighCutoff = null,
                    //Notch = null,
                };

                eegChannels.Add(eegChannel);
            }

            return(eegChannels);
        }
Esempio n. 2
0
 public EegChannelTsv(EegChannel eegChannel)
 => _m = eegChannel;