From 6e51473017c0c79d2178e275f04cc27d8bb9a3cd Mon Sep 17 00:00:00 2001 From: rblanc Date: Tue, 2 Apr 2013 15:47:30 +0200 Subject: [PATCH] small fixes in fusion sequence visualization mode --- vv/vvMainWindow.cxx | 3 ++- vv/vvOverlayPanel.cxx | 8 ++++---- vv/vvSlicerManager.cxx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index a06870f..34e66ad 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -2474,7 +2474,7 @@ void vvMainWindow::SelectFusionSequenceCorrespondances() { bool signalOK = true; unsigned nbFrameMain = mSlicerManagers[index]->GetImage()->GetTransform().size(); unsigned nbFrameSecondary = mSlicerManagers[index]->GetFusionSequenceNbFrames(); - +std::cout<<"nbFrameMain = "< temporalCorrespondances; if ( tmpVect.size() == nbFrameMain + nbFrameSecondary ) { for (unsigned i=0 ; i fileNam mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str(); itk::ImageIOBase::Pointer reader = itk::ImageIOFactory::CreateImageIO( file.toStdString().c_str(), itk::ImageIOFactory::ReadMode); + std::sort (fileNames.begin(), fileNames.end());//make sure the files are sorted. reader->SetFileName(fileNames[0].c_str()); reader->ReadImageInformation(); std::string component = reader->GetComponentTypeAsString(reader->GetComponentType()); diff --git a/vv/vvOverlayPanel.cxx b/vv/vvOverlayPanel.cxx index b394bb5..3490933 100644 --- a/vv/vvOverlayPanel.cxx +++ b/vv/vvOverlayPanel.cxx @@ -264,7 +264,7 @@ void vvOverlayPanel::getFusionSequenceProperty(int sequenceFrameIndex, bool spat fCTUSFrame->setEnabled(1); fCTUSSlider->setEnabled(1); fCTUSSlider->setValue(sequenceFrameIndex); - fCTUSSlider->setMaximum(sequenceLenth); + fCTUSSlider->setMaximum(sequenceLenth-1); //the maximum IS included, since we start at 0, go until n-1! if (spatialSync) fCTUSActivateSpaceSyncCheckBox->setCheckState(Qt::Checked); else fCTUSActivateSpaceSyncCheckBox->setCheckState(Qt::Unchecked); if (fCTUSActivateTimeSyncCheckBox->isEnabled()) { @@ -292,7 +292,7 @@ void vvOverlayPanel::setFusionSequenceProperty() { if (disableFusionSequenceSignals) return; - emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum(), fCTUSActivateTimeSyncCheckBox->isChecked()); + emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum()+1, fCTUSActivateTimeSyncCheckBox->isChecked()); } void vvOverlayPanel::enableFusionSequenceTemporalSync() { @@ -303,7 +303,7 @@ void vvOverlayPanel::enableFusionSequenceTemporalSync() { disableFusionSequenceSignals = backup; // if (disableFusionSequenceSignals) return; - emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum(), fCTUSActivateTimeSyncCheckBox->isChecked()); + emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum()+1, fCTUSActivateTimeSyncCheckBox->isChecked()); } void vvOverlayPanel::updateFusionSequenceSliderValueFromWindow(int val, bool updateVisualization) { @@ -314,7 +314,7 @@ void vvOverlayPanel::updateFusionSequenceSliderValueFromWindow(int val, bool upd disableFusionSequenceSignals = false; if (disableFusionSequenceSignals) return; - if (updateVisualization) emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum(), fCTUSActivateTimeSyncCheckBox->isChecked()); + if (updateVisualization) emit FusionSequencePropertyUpdated(fCTUSSlider->value(), fCTUSActivateSpaceSyncCheckBox->isChecked(), fCTUSSlider->maximum()+1, fCTUSActivateTimeSyncCheckBox->isChecked()); } void vvOverlayPanel::VFColorChangeRequest() diff --git a/vv/vvSlicerManager.cxx b/vv/vvSlicerManager.cxx index e975da2..24ec62a 100644 --- a/vv/vvSlicerManager.cxx +++ b/vv/vvSlicerManager.cxx @@ -351,7 +351,7 @@ bool vvSlicerManager::SetFusionSequence(std::vector filenames, int } //adjust the time slider in the overlay panel - mFusionSequenceNbFrames = mFusionSequenceReader->GetOutput()->GetTransform().size()-1; //actually, this is the maximum index... + mFusionSequenceNbFrames = mFusionSequenceReader->GetOutput()->GetTransform().size(); mFusionSequenceFrameIndex = std::max( 0, std::min(mFusionSequenceFrameIndex, mFusionSequenceNbFrames)); return true; -- 2.47.1