//------------------------------------------------------------------------------
vvSlicer::vvSlicer()
{
- mFusionSequenceFlag = false;
+ mFusionSequenceCode = -1;
this->UnInstallPipeline();
mImage = NULL;
mReducedExtent = new int[6];
mCurrentBeforeSlicingTransform[1]=y;
mCurrentBeforeSlicingTransform[2]=z;
mSlicingTransform->GetInverse()->TransformPoint(mCurrentBeforeSlicingTransform,mCurrent);
- SetTSlice(t);
+ if (t>=0) SetTSlice(t);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvSlicer::SetFusion(vvImage::Pointer fusion, bool fusionSequenceFlag)
+void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
{
- mFusionSequenceFlag = fusionSequenceFlag;
+ mFusionSequenceCode = fusionSequenceCode;
if (fusion->GetVTKImages().size()) {
mFusion = fusion;
}
}
//update the fusion ; except in case this is a fusionSequence, in which case both 'times' should be independent.
- if (mFusion && mFusionActor->GetVisibility() && !mFusionSequenceFlag) {
+ if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode<0)) {
if (mFusion->GetVTKImages().size() > (unsigned int)t) {
mCurrentFusionTSlice = t;
mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice]);
//------------------------------------------------------------------------------
void vvSlicer::SetFusionSequenceTSlice(int t)
{
- if (mFusion && mFusionActor->GetVisibility() && mFusionSequenceFlag) {
+ if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode>=0)) {
if (mFusion->GetVTKImages().size() > (unsigned int)t) {
mCurrentFusionTSlice = t;
mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice] );
int t = mCurrentTSlice;
if(mOverlay)
t = std::max(t, mCurrentOverlayTSlice);
- if(mFusion&& (!mFusionSequenceFlag)) //ignore fusionSequence data: for these, the times are not to be related (this way)
+ if(mFusion&& (mFusionSequenceCode<0)) //ignore fusionSequence data: for these, the times are not to be related (this way)
t = std::max(t, mCurrentFusionTSlice);
return t;
}
//----------------------------------------------------------------------------
void vvSlicer::SetDisplayMode(bool i)
{
- this->GetRenderer()->SetDraw(i);
- if (i)
- UpdateDisplayExtent();
+ this->GetRenderer()->SetDraw(i);
+ if (i) UpdateDisplayExtent();
}
//----------------------------------------------------------------------------
iy = lrint(Y);
iz = lrint(Z);
- image->UpdateInformation();
-
if (ix < image->GetWholeExtent()[0] ||
ix > image->GetWholeExtent()[1] ||
iy < image->GetWholeExtent()[2] ||
double yCursor = (y - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
double zCursor = (z - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
- if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0] &&
- xCursor < this->GetImageActor()->GetDisplayExtent()[1]+1 &&
- yCursor >= this->GetImageActor()->GetDisplayExtent()[2] &&
- yCursor < this->GetImageActor()->GetDisplayExtent()[3]+1 &&
- zCursor >= this->GetImageActor()->GetDisplayExtent()[4] &&
- zCursor < this->GetImageActor()->GetDisplayExtent()[5]+1 ) {
+ if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0]-0.5 &&
+ xCursor < this->GetImageActor()->GetDisplayExtent()[1]+0.5 &&
+ yCursor >= this->GetImageActor()->GetDisplayExtent()[2]-0.5 &&
+ yCursor < this->GetImageActor()->GetDisplayExtent()[3]+0.5 &&
+ zCursor >= this->GetImageActor()->GetDisplayExtent()[4]-0.5 &&
+ zCursor < this->GetImageActor()->GetDisplayExtent()[5]+0.5 ) {
vtkRenderer * renderer = this->Renderer;
renderer->WorldToView(x,y,z);