mSubSampling = 5;
mScale = 1;
mVFLog = 0;
+ mVFWidth = 1;
std::string text = "F1 = sagital; F2 = coronal; F3 = axial\n";
text += "F5 = horizontal flip; F6 = vertical flip\n\n";
{
mImage = image;
this->Superclass::SetInput(image->GetVTKImages()[0]);
+
+ // Prevent crash when reload -> change slice if outside extent
+ int extent[6];
+ this->GetInput()->GetWholeExtent(extent);
+ if (SliceOrientation == 0) {
+ if (Slice >= extent[1]) {
+ Slice = (extent[1]-extent[0])/2.0;
+ }
+ }
+ if (SliceOrientation == 1) {
+ if (Slice >= extent[3]) {
+ Slice = (extent[3]-extent[2])/2.0;
+ }
+ }
+ if (SliceOrientation == 2) {
+ if (Slice >= extent[5]) {
+ Slice = (extent[5]-extent[4])/2.0;
+ }
+ }
+
this->UpdateDisplayExtent();
mCurrentTSlice = 0;
ca->SetText(0,mFileName.c_str());
mVFActor = vtkActor::New();
mVFActor->SetMapper(mVFMapper);
mVFActor->SetPickable(0);
+ mVFActor->GetProperty()->SetLineWidth(mVFWidth);
this->UpdateDisplayExtent();
this->GetRenderer()->AddActor(mVFActor);
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvSlicer::SetVFWidth(int width)
+{
+ mVFWidth = width;
+ if (mVFActor)
+ mVFActor->GetProperty()->SetLineWidth(mVFWidth);
+ UpdateDisplayExtent();
+ Render();
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvSlicer::SetVFLog(int log)
// DD("SetSlice de slicer = Render");
- this->Render();
+ // Seems to work without this line
+ // this->Render();
}
//----------------------------------------------------------------------------