Beispiel #1
0
 /// <summary>
 /// 
 /// </summary>
 public TrtModel()
 {
     _treatmentConfig = new TreatmentConfig();
     _selectedFeatures = new ObservableCollection<string>();
     _selectedFeatures.CollectionChanged += SelectedFeaturesChanged;
     _pipeline = new Pipeline();
     _preTreatedFrames = new ObservableCollection<Frame>();
 }
Beispiel #2
0
        /// <summary>
        /// Called before starting the movement detection process. It builds the proper pipeline depending on whether
        /// a threshold-based or a pattern-recognition-based movement detection is bein performed
        /// </summary>
        private void PreparePipeline()
        {
            _pipeline = new Pipeline();

            _acquisitionController.dataProvider = _dataProvider;
            _acquisitionController.recordingConfig = recordingConfig;

            if (!levelControlled)
            {
                _acquisitionController.dataMonitoring = true;
                _thresholdEngine.monitoring = false;

                _windowMaker.config = _patternRecognizer.trainingPackage.treatmentConfig;
                _featureExtractor.selectedFeatures = _patternRecognizer.trainingPackage.treatmentConfig.features;
                _patternRecognition.patternRecognizer = _patternRecognizer;

                _movementGenerator.multipleActivation = multipleActivation;
                _movementGenerator.activationLevel = _patternRecognizer.activationLevel;
                _movementGenerator.activationTolerance = _patternRecognizer.activationTolerance;
                _movementGenerator.movementCodes = _patternRecognizer.trainingPackage.movementCodes;

                _pipeline.AddStage(_acquisitionController);
                _pipeline.AddStage(_windowMaker);
                _pipeline.AddStage(_featureExtractor);
                _pipeline.AddStage(_patternRecognition);
                _pipeline.AddStage(_movementGenerator);
            }
            else
            {
                _acquisitionController.dataMonitoring = false;
                _thresholdEngine.monitoring = true;

                _movementGenerator.multipleActivation = false;
                _movementGenerator.activationLevel = 1;
                _movementGenerator.thresholdControls.Clear();

                foreach (ThresholdControl item in thresholdControls)
                    _movementGenerator.thresholdControls.Add(item);

                _thresholdEngine.recordingConfig = recordingConfig;

                //TODO: This does not work as it is
                //Where sould the RecordingConfig for the EMGDataProvider come from?

                _pipeline.AddStage(_acquisitionController);

                _pipeline.AddStage(_thresholdEngine);

                //TODO: We have a processed signal that can be compared against thresholds stored in a
                //ThresholdSet object. Now we need a stage that will generate activations on each channel.
                //Perhaps this can be incorporated directly into the MovementGenerator class.

                _pipeline.AddStage(_movementGenerator);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Basic attribute initialization. Full configuration must be performed by a client class using this model.
        /// </summary>
        public AcqModel()
        {
            this.PropertyChanged += AcqModel_PropertyChanged;
            recordingConfig = new RecordingConfig();
            recordedData = new Recording(recordingConfig);
            _acqPipeline = new Pipeline();
            dataProvider = "none";
            _selectedMovements = new ObservableCollection<Movement>();
            _selectedMovements.CollectionChanged += SelectedMovements_CollectionChanged;
            recordingValid = false;

            _fileReadWriters = new List<IFileReadWriter>();

            //Initialization of available IFileReadWriters
            _fileReadWriters.Add(new HDF5RecordingReadWriter());

            //Composing filter string
            fileFilters = "";

            foreach (IFileReadWriter fileReadWriter in _fileReadWriters)
            {
                fileFilters = fileFilters + fileReadWriter.supportedFormats.ToString() + "|";
            }

            fileFilters = fileFilters + "All Files (*.*)|*.*";
        }