Dear Mitk users,
I am still struggling with displaying a curved MPR, based on a set of
points placed on the axial view by the user.
I wrote a piece of code similar to the one presented in a quite old
thread
(http://mitk-users.1123740.n5.nabble.com/Curved-MPR-is-cropped-for-some-reason-td2823.html,
dating back from 2011). The workflow is the following:
- create a ThinPlateSplineCurvedGeometry
- give a frameGeometry (the same one as the dicom image) and a
referenceGeometry to it
- create a PlaneLandmarkProjector
- give a projection plane and the landmarks to it
- give the projector and the landmark to the ThinPlateSplineCurvedGeometry
- compute the geometry of the ThinPlateSplineCurvedGeometry
- give the ThinPlateSplineCurvedGeometry to the multiWidget through
SetWorldGeometry3D.
However, the code crashes on the last instruction (SetWorldGeometry3D)
with a cryptic message ("0xC0000005: /Access violation reading..."/).
First, is this workflow correct? I saw other examples, where the
ThinPlateSplineCurvedGeometry was also added to the datastorage (I tried
it, and the same crash appears).
Second, I also looked at the code for the curvedmpr pluging (at
http://mitk.org/git/?p=MITK.git;a=shortlog;h=refs/heads/bug-10719-curved-mpr-master-integration),
and I have the impression that the main difference with the workflow I
use is that the ThinPlateSplineCurvedGeometry is added to the
datastorage. Moreover, it seems like development was stopped in 2014, is
that correct?
I would greatly appreciate any help about the correct workflow to
display a curved MPR, or comments about my code below.
Best regards,
Daphné
Code snippet:
mitk::DataNode::Pointer originalImageNode =
_ds->GetNamedNode("originalImage");
const mitk::PointSet::DataType::PointsContainer::Pointer
splineLandmarks = mitk::PointSet::DataType::PointsContainer::New();
// Get landmarks...
if (splineLandmarks->Size() != 0 && originalImageNode->GetData())
{
mitk::ThinPlateSplineCurvedGeometry::Pointer tpsGeometry =
mitk::ThinPlateSplineCurvedGeometry::New();
const mitk::PlaneGeometry *plane =
_dataView->GetRenderWindow2()->GetSliceNavigationController()->GetCurrentPlaneGeometry();
// Set a reference 3D geometry (e.g. Geometry3D of an existing
image volume)
tpsGeometry->SetFrameGeometry(originalImageNode->GetData()->GetGeometry());
tpsGeometry->SetReferenceGeometry(plane->GetReferenceGeometry());
// Create projector class; target landmarks will be projected on
// a plane to create source landmarks for thin plate spline
// (plane is a mitk::PlaneGeometry, e.g. one of the standard
// coronal, sagittal, or transversal planes)
mitk::PlaneLandmarkProjector::Pointer planeLandmarkProjector =
mitk::PlaneLandmarkProjector::New();
planeLandmarkProjector->SetProjectionPlane(plane);
planeLandmarkProjector->ProjectLandmarks(splineLandmarks);
// Initialize TPS geometry with projector
tpsGeometry->SetLandmarkProjector(planeLandmarkProjector);
tpsGeometry->SetTargetLandmarks(splineLandmarks);
tpsGeometry->ComputeGeometry();
mitk::BaseRenderer* mappingRenderer =
mitk::BaseRenderer::GetInstance(_dataView->mitkWidget2->GetRenderWindow());
mappingRenderer->SetWorldGeometry3D(tpsGeometry); // Crash
happens here
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
Le 02/03/2017 à 14:44, Daphné Wallach a écrit :
Dear MITK users,
I am developping an application using MITK as a library, and I am
currently trying to display a curved MPR, based on a set of points
placed on the axial view by the user.
I saw two related questions in the mailing list, but both answers were
quite dated (2010 and 2014), so things might have changed since then.
The most recent answer referred to a "Curved MPR" plugin, and
mentionned it was under developpement.
Does anybody have news about this plugin?
Best regards,
Daphné
--
Daphné Wallach
Ingénieur de recherche
http://www.hrv-simulation.com
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users