]> Creatis software - clitk.git/commitdiff
small fixes in fusion sequence visualization mode
authorrblanc <rblanc33@gmail.com>
Tue, 2 Apr 2013 13:47:30 +0000 (15:47 +0200)
committerrblanc <rblanc33@gmail.com>
Tue, 2 Apr 2013 13:47:30 +0000 (15:47 +0200)
vv/vvMainWindow.cxx
vv/vvOverlayPanel.cxx
vv/vvSlicerManager.cxx

index a06870f5baf2074d74856776a9b49c36ff9e0adf..34e66ada5ba799c0ac7d3ad173cc3fed3642236d 100644 (file)
@@ -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 = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSecondary<<", signal size: "<<tmpVect.size()<<std::endl;
   std::vector<unsigned> temporalCorrespondances;
   if ( tmpVect.size() == nbFrameMain + nbFrameSecondary ) {
     for (unsigned i=0 ; i<tmpVect.size() ; i++) {
@@ -2517,6 +2517,7 @@ void vvMainWindow::AddFusionSequence(int index, std::vector<std::string> 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());
index b394bb55de4fc079c9c8e1123f8723d1de27661a..3490933fb89b3ce180af5d8bdf1bc598d4167c77 100644 (file)
@@ -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()
index e975da28babd5ee04bdb31120ccd77bd50b5412f..24ec62a36d6d8473d0a6c8cb61aa34b067362cce 100644 (file)
@@ -351,7 +351,7 @@ bool vvSlicerManager::SetFusionSequence(std::vector<std::string> filenames, int
        }\r
 \r
        //adjust the time slider in the overlay panel\r
-       mFusionSequenceNbFrames = mFusionSequenceReader->GetOutput()->GetTransform().size()-1; //actually, this is the maximum index...\r
+       mFusionSequenceNbFrames = mFusionSequenceReader->GetOutput()->GetTransform().size()\r
        mFusionSequenceFrameIndex = std::max<int>( 0, std::min<int>(mFusionSequenceFrameIndex, mFusionSequenceNbFrames));\r
 \r
        return true;\r