Esempio n. 1
0
        public WhiskerAngularVelocityViewModel(AnalyserViewModel parent)  : base(parent, "Whisker Angular Velocity")
        {
            Model = ModelResolver.Resolve <IWhiskerAngularVelocity>();

            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new WhiskerAngularVelocityView()
            {
                DataContext = this,
            };

            ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>();

            IWhisker nosePoint        = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1);
            IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0);

            if (nosePoint != null && orientationPoint != null)
            {
                angleOptions.Add(new CenterLineViewModel());
            }

            angleOptions.Add(new VerticalViewModel());
            angleOptions.Add(new HorizontalViewModel());

            AngleOptions        = angleOptions;
            SelectedAngleOption = AngleOptions.First();

            Initialise();
        }
Esempio n. 2
0
        public WhiskerAngleViewModel(AnalyserViewModel parent, string name = "Whisker Angle")
            : base(parent, name)
        {
            Model = ModelResolver.Resolve<IWhiskerAngle>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new WhiskerAngleMethodView()
            {
                DataContext = this,
            };

            Initialise();

            ObservableCollection<AngleTypeBase> angleOptions = new ObservableCollection<AngleTypeBase>();

            IWhisker nosePoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1);
            IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0);

            if (nosePoint != null && orientationPoint != null)
            {
                angleOptions.Add(new CenterLineViewModel());
            }

            angleOptions.Add(new VerticalViewModel());
            angleOptions.Add(new HorizontalViewModel());

            AngleOptions = angleOptions;
            SelectedAngleOption = AngleOptions.First();
        }
        public WhiskerAmplitudeViewModel(AnalyserViewModel parent) : base(parent, "Whisker Amplitude")
        {
            Model = ModelResolver.Resolve <IWhiskerAmplitude>();

            MethodControl = new WhiskerAmplitudeView()
            {
                DataContext = this,
            };
        }
Esempio n. 4
0
        public WhiskerProtractionRetractionViewModel(AnalyserViewModel parent) : base(parent, "Whisker Protraction/Retraction Velocity")
        {
            Model = ModelResolver.Resolve <IWhiskerProtractionRetraction>();

            MethodControl = new WhiskerProtractionRetractionView()
            {
                DataContext = this,
            };
        }
        public WhiskerAmplitudeViewModel(AnalyserViewModel parent)
            : base(parent, "Whisker Amplitude")
        {
            Model = ModelResolver.Resolve<IWhiskerAmplitude>();

            MethodControl = new WhiskerAmplitudeView()
            {
                DataContext = this,
            };
        }
        public WhiskerProtractionRetractionViewModel(AnalyserViewModel parent)
            : base(parent, "Whisker Protraction/Retraction Velocity")
        {
            Model = ModelResolver.Resolve<IWhiskerProtractionRetraction>();

            MethodControl = new WhiskerProtractionRetractionView()
            {
                DataContext = this,
            };
        }
Esempio n. 7
0
        public IActionResult Remove([FromForm] AnalyserViewModel viewModel)
        {
            var dbAnalyser = _dbContext.Analysers.FirstOrDefault(l => l.Id == viewModel.Id);

            if (dbAnalyser != null)
            {
                _dbContext.Analysers.Remove(dbAnalyser);
                _dbContext.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Esempio n. 8
0
        public HeadOrientationViewModel(AnalyserViewModel parent) : base(parent, "Head Orientation")
        {
            Model = ModelResolver.Resolve <IHeadOrientation>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new HeadOrientationView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 9
0
        public WhiskerVelocityViewModel(AnalyserViewModel parent) : base(parent, "Whisker Velocity")
        {
            Model = ModelResolver.Resolve <IWhiskerVelocity>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new WhiskerVelocityView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 10
0
        public HeadOrientationViewModel(AnalyserViewModel parent)
            : base(parent, "Head Orientation")
        {
            Model = ModelResolver.Resolve<IHeadOrientation>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new HeadOrientationView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 11
0
        public WhiskerVelocityViewModel(AnalyserViewModel parent)
            : base(parent, "Whisker Velocity")
        {
            Model = ModelResolver.Resolve<IWhiskerVelocity>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            CreateFrames();

            MethodControl = new WhiskerVelocityView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 12
0
        public NoseDisplacementViewModel(AnalyserViewModel parent) : base(parent, "Nose Displacement")
        {
            Model = ModelResolver.Resolve <INoseDisplacement>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());

            MethodControl = new NoseDisplacementView()
            {
                DataContext = this,
            };

            ShowFrameSlider = false;

            Initialise();
        }
Esempio n. 13
0
        public NoseDisplacementViewModel(AnalyserViewModel parent)
            : base(parent, "Nose Displacement")
        {
            Model = ModelResolver.Resolve<INoseDisplacement>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());

            MethodControl = new NoseDisplacementView()
            {
                DataContext = this,
            };

            ShowFrameSlider = false;

            Initialise();
        }
Esempio n. 14
0
        private void OpenAnalyserWindow()
        {
            string message;

            if (!ValidateResults(out message))
            {
                MessageBox.Show("Unable to analyse video: " + message);
                return;
            }

            AnalyserViewModel viewModel = new AnalyserViewModel(m_Frames, WhiskerVideo);
            AnalyserView      view      = new AnalyserView()
            {
                DataContext = viewModel,
            };

            view.ShowDialog();
        }
Esempio n. 15
0
        public WhiskerFrequencyViewModel(AnalyserViewModel parent) : base(parent, "Whisker Frequency")
        {
            FrequencyTypes = new ObservableCollection <FrequencyTypeBaseViewModel>()
            {
                new AutocorrelogramViewModel(),
                new DiscreteFourierTransformViewModel(),
            };

            Model = ModelResolver.Resolve <IWhiskerFrequency>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            SelectedFrequencyType = FrequencyTypes.First();

            CreateFrames();

            MethodControl = new WhiskerFrequencyView()
            {
                DataContext = this,
            };

            Initialise();
        }
        public AnalyseEverythingViewModel(AnalyserViewModel parent) : base(parent, "Analyse Everything")
        {
            ObservableCollection <AnalyseEverythingBaseViewModel> analysisMethods = new ObservableCollection <AnalyseEverythingBaseViewModel>();

            foreach (MethodBase method in parent.AnalysisMethods)
            {
                if (method is NoseDisplacementViewModel || method is WhiskerFrequencyViewModel || method is WhiskerMeanOffsetViewModel || method is WhiskerAmplitudeViewModel || method is WhiskerProtractionRetractionViewModel)
                {
                    analysisMethods.Add(new AnalyseEverythingBaseViewModel(this, method));
                }
            }

            AnalysisMethods = analysisMethods;

            ItemsToAnalyse = new ObservableCollection <AnalyseEverythingBaseViewModel>();

            MethodControl = new AnalyseEverythingView()
            {
                DataContext = this,
            };

            ShowFrameSlider = false;

            ObservableCollection <AngleTypeBase> angleOptions = new ObservableCollection <AngleTypeBase>();

            angleOptions.Add(new CenterLineViewModel());
            angleOptions.Add(new VerticalViewModel());
            angleOptions.Add(new HorizontalViewModel());
            AngleOptions        = angleOptions;
            SelectedAngleOption = AngleOptions.First();

            ObservableCollection <FrequencyTypeBaseViewModel> frequencyTypes = new ObservableCollection <FrequencyTypeBaseViewModel>();

            frequencyTypes.Add(new AutocorrelogramViewModel());
            frequencyTypes.Add(new DiscreteFourierTransformViewModel());
            FrequencyTypes        = frequencyTypes;
            SelectedFrequencyType = FrequencyTypes.First();

            Initialise();
        }
        public AnalyseEverythingViewModel(AnalyserViewModel parent)
            : base(parent, "Analyse Everything")
        {
            ObservableCollection<AnalyseEverythingBaseViewModel> analysisMethods = new ObservableCollection<AnalyseEverythingBaseViewModel>();

            foreach (MethodBase method in parent.AnalysisMethods)
            {
                if (method is NoseDisplacementViewModel || method is WhiskerFrequencyViewModel || method is WhiskerMeanOffsetViewModel || method is WhiskerAmplitudeViewModel || method is WhiskerProtractionRetractionViewModel)
                {
                    analysisMethods.Add(new AnalyseEverythingBaseViewModel(this, method));
                }
            }

            AnalysisMethods = analysisMethods;

            ItemsToAnalyse = new ObservableCollection<AnalyseEverythingBaseViewModel>();

            MethodControl = new AnalyseEverythingView()
            {
                DataContext = this,
            };

            ShowFrameSlider = false;

            ObservableCollection<AngleTypeBase> angleOptions = new ObservableCollection<AngleTypeBase>();
            angleOptions.Add(new CenterLineViewModel());
            angleOptions.Add(new VerticalViewModel());
            angleOptions.Add(new HorizontalViewModel());
            AngleOptions = angleOptions;
            SelectedAngleOption = AngleOptions.First();

            ObservableCollection<FrequencyTypeBaseViewModel> frequencyTypes = new ObservableCollection<FrequencyTypeBaseViewModel>();
            frequencyTypes.Add(new AutocorrelogramViewModel());
            frequencyTypes.Add(new DiscreteFourierTransformViewModel());
            FrequencyTypes = frequencyTypes;
            SelectedFrequencyType = FrequencyTypes.First();

            Initialise();
        }
Esempio n. 18
0
        public WhiskerFrequencyViewModel(AnalyserViewModel parent)
            : base(parent, "Whisker Frequency")
        {
            FrequencyTypes = new ObservableCollection<FrequencyTypeBaseViewModel>()
            {
                new AutocorrelogramViewModel(),
                new DiscreteFourierTransformViewModel(),
            };

            Model = ModelResolver.Resolve<IWhiskerFrequency>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            SelectedFrequencyType = FrequencyTypes.First();

            CreateFrames();

            MethodControl = new WhiskerFrequencyView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 19
0
        public WhiskerSpreadViewModel(AnalyserViewModel parent) : base(parent, "Whisker Spread")
        {
            IWhisker nosePoint        = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == -1);
            IWhisker orientationPoint = Parent.CurrentFrame.Whiskers.Select(x => x.Model).FirstOrDefault(x => x.WhiskerId == 0);

            if (nosePoint == null || orientationPoint == null)
            {
                //Can't work!
                return;
            }

            Model = ModelResolver.Resolve <IWhiskerSpread>();
            Model.LoadData(parent.Frames.Values.Select(x => x.Model).ToArray());
            Model.UpdateTValue(0);
            CreateFrames();

            MethodControl = new WhiskerSpreadView()
            {
                DataContext = this,
            };

            Initialise();
        }
Esempio n. 20
0
 protected MethodBaseWithImage(AnalyserViewModel parent, string methodName) : base(parent, methodName)
 {
 }
Esempio n. 21
0
 protected MethodBase(AnalyserViewModel parent, string methodName)
 {
     MethodName = methodName;
     Parent = parent;
 }
Esempio n. 22
0
 public OpenCommand(MainBusyService busyService, AnalyserViewModel analyserViewModel, MainViewIdentifier mainViewIdentifier)
 {
     this.busyService        = busyService;
     this.analyserViewModel  = analyserViewModel;
     this.mainViewIdentifier = mainViewIdentifier;
 }
Esempio n. 23
0
 protected MethodBase(AnalyserViewModel parent, string methodName)
 {
     MethodName = methodName;
     Parent     = parent;
 }
Esempio n. 24
0
 protected MethodBaseWithImage(AnalyserViewModel parent, string methodName)
     : base(parent, methodName)
 {
 }