Hi Michael,
It seems a few things are still missing in your code. In your initialization
code, could you try the following:
// Set a reference 3D geometry (e.g. Geometry3D of an existing image volume)
tpsGeometry->SetFrameGeometry(imagegeometry)
// Set stiffness of spline (optional)
tpsGeometry->SetSigma(sigma);
// 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)
planeLandmarkProjector = mitk::PlaneLandmarkProjector::New();
planeLandmarkProjector ->SetProjectionPlane( plane );
// Initialize TPS geometry with projector
tpsGeometry->SetLandmarkProjector(m_PlaneLandmarkProjector);
For rebuilding the TPS surface, call
m_TPSGeometry->ComputeGeometry();
Also, you need to use a properly initialized and rendered GeometryData. The
easiest way is to use an existing GeometryData object from one of the render
windows. The 3D render window (widget4) can be used, since changing its 2D
Geometry has no other effect. Of course, a new separate plane can also be
created with a bit more work, but this would help you getting started:
// Get renderer from widget4 (3D render window)
m_MappingRenderer =
mitk::BaseRenderer::GetInstance(multiWidget->mitkWidget4->GetRenderWindow());
// Get geometry2DData from it and set necessary properties
mitk::DataTreeNode::Pointer tpsGeometryDataNode =
m_MappingRenderer->GetCurrentWorldGeometry2DNode();
tpsGeometryDataNode ->SetIntProperty("xresolution", 200); // x-resolution for
rendering the curved plane
tpsGeometryDataNode ->SetIntProperty("yresolution", 200); // y-resolution for
rendering the curved plane
tpsGeometryDataNode ->SetProperty( "name", mitk::StringProperty::New( "curved
plane" ) );
// For convenience: exclude extent of this plane when calculating DataTree
bounding box
tpsGeometryDataNode ->SetProperty("includeInBoundingBox",
mitk::BoolProperty::New(false));
child->Add(tpsGeometryDataNode);
// Set new 2D geometry for this mapper (required for the
Geometry2DDataVtkMapper3D)
m_MappingRenderer->SetWorldGeometry(m_TPSGeometry);
Hope that helps, please let us know if you run into further issues.
Regards,
Mathias
From: Kelm, Michael [mailto:[email protected]]
Sent: Thursday, November 12, 2009 5:26 PM
To: Seitel Mathias; [email protected]
Subject: RE: Curved MPR
Hi Mathias,
thank you for your quick help. I tried the following:
// setup TPS transform
mitk::ThinPlateSplineCurvedGeometry::Pointer pTPS =
mitk::ThinPlateSplineCurvedGeometry::New();
pTPS->SetTargetLandmarks(m_pSelectedPntSet->GetPointSet()->GetPoints());
// create mitk::GeometryData
mitk::GeometryData::Pointer pGeometryData = mitk::GeometryData::New();
pGeometryData->SetGeometry(pTPS);
// replace data tree node
mitk::DataTreeHelper::RemoveNode("CurvedMPR");
mitk::DataTreeNode::Pointer pNode = mitk::DataTreeNode::New();
pNode->SetData(pGeometryData);
mitk::DataTreeHelper::AddNode("CurvedMPR",pNode);
The node appears in the data tree but does not have any effect. Is there a
special way I have to insert the node?
Does it matter whether it is in front of or behind the image volume? Added to
the root or to the image node?
Thank you,
Michael.
________________________________
From: Seitel Mathias [mailto:[email protected]]
Sent: Thursday, November 12, 2009 10:05 AM
To: Kelm, Michael; [email protected]
Subject: RE: Curved MPR
Hi Michael,
MITK does support curved MPRs. They integrate nicely into the geometry
framework of MITK: The class mitk::ThinPlateSplineCurvedGeometry derives from
mitk::Geometry2D and thus represents a curved 2D plane in space. The spline
geometry is defined by landmarks in 3D space.
Curved MPRs can be visualized using the mappers mitk::Geometry2DDataMapper2D
(for flat mappings in 2D views) and mitk::Geometry2DDataVtkMapper3D (for curved
mappings in 3D views). To do so, an mitk::GeometryData object containing a
properly initialized instance of mitk::ThinPlateSplineCurvedGeometry needs to
be created and inserted into the DataStorage. The mapper then reslices all
visible data with this curved 2D plane (in the same way as the "normal" 2D
geometries for transversal, sagittal and coronal directions are displayed).
Regards,
Mathias
From: Kelm, Michael [mailto:[email protected]]
Sent: Thursday, November 12, 2009 9:44 AM
To: [email protected]
Subject: [mitk-users] Curved MPR
Hi,
Does MITK support curved MPRs?
If not, what would be the best way to implement that? Would I have to write a
new Mapper2D?
How could I use of such a new 2D mapper for volume data?
Thanks,
Michael.
Siemens AG
Corporate Technology
CT SE 5
Günther-Scharowsky-Str. 1
91058 Erlangen, Deutschland
Tel.: +49 (9131) 7-34627
Fax: +49 (9131) 7-33190
Mobil: +49 (173) 6974642
mailto:[email protected]
Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Gerhard Cromme;
Vorstand: Peter Löscher, Vorsitzender; Wolfgang Dehen, Heinrich Hiesinger, Joe
Kaeser, Barbara Kux, Hermann Requardt, Siegfried Russwurm, Peter Y. Solmssen;
Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin
Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users