(sent again also for the user group)
Dear Mathias,
I have attached my DoImageProcessing() function.
Basically I have followed the procedure of creating a simple plug-in and added
my functionality in the mentioned function.
Wworkflow description:1. load DICOM Series.2. Press Point Set Interaction.3.
Add point set named "aaa"4. add 6 points on the axial image (same slice)5.
press my plug in Icon6. select image node from data source using the mouse
click7. press the button the execute my function (DoImageProcessing)
It should be noted the I am using nightly version mitk-0.99.1
Many thanks for your support
Best regards,Tal
--- On Thu, 11/11/10, Seitel Mathias <[email protected]> wrote:
From: Seitel Mathias <[email protected]>
Subject: AW: AW: [mitk-users] Curved MPR
To: "Tal Eisenberg" <[email protected]>
Cc: "mitk-users ([email protected])"
<[email protected]>
Date: Thursday, November 11, 2010, 10:52 AM
Dear Tal,
Ok...
> I can see the points but without any image.
> (the curve \ plane is being displayed on the
other viewers)
Do you mean that the intersection of the curved plane with the 2D imaging
planes is displayed in the 2D render windows, but nothing is displayed in the
3D render window?
If this is Ok for you, could you send us the code of your plug-in (or a
compilable part of it for the curved MPRs), that would probably better help to
understand what is going wrong.
Regards,
Mathias
>
> 2. I would like to display Cross sectional image every 2 mm , on the curve ( i
> am planning to iterate on each point and to draw the desired Cross sectional
> image.
>
> I appreciate your support.
>
> Best Regards,
> Tal
>
> --- On Wed, 11/10/10, Seitel Mathias <[email protected]> wrote:
>
>
>
> From:
Seitel Mathias <[email protected]>
> Subject: AW: [mitk-users] Curved MPR
> To: "Tal Eisenberg" <[email protected]>, "mitk-
> [email protected]" <[email protected]>
> Date: Wednesday, November 10, 2010, 4:52 PM
>
>
>
> Dear Tal,
>
>
>
> Your code looks fine on a quick sight. It may be easier to understand
> if you show us more of
the context of your application: What does your
> PointSet (currentPointSet) contain (how many points)? How is the input
> image initialized?
>
>
>
> What I’m missing from your code is a request to update the
> rendering system. If you are not doing this already try:
>
>
>
> m_MappingRenderer->GetDisplayGeometry()->Fit();
>
> mitk::RenderingManager::GetInstance()->RequestUpdateAll();
>
>
>
>
>
> Regarding your second question, I’m not sure if I get it right: do you
> mean calculating the geodesic distance between two points on the curved
> geometry the filter calculates?
>
>
>
>
>
> Best regards,
>
>
Mathias
>
>
>
>
>
> Von: Tal Eisenberg [mailto:[email protected]]
> Gesendet: Dienstag, 9. November 2010 15:38
> An: [email protected]
> Betreff: [mitk-users] Curved MPR
>
>
>
> Hi all,
>
>
>
> I am trying to display a Curved MPR .
>
>
>
> 1. I have a point set which was set on the axial image, and I have manged to
> create the curve and the plane, however I cannot manged to display it on the
> viewer as CMPR (Please refer the code bellow)
>
>
>
> 2. Can I determine the
distance between the points on the curve (in order to
> present Cross sectional images) ?
>
>
>
> Any help would be appreciated
>
>
>
> Thanks
>
> Tal
>
> ---------------
>
> m_PointSetToCurvedGeometryFilter =
> mitk::PointSetToCurvedGeometryFilter::New();
>
>
>
>
>m_PointSetToCurvedGeometryFilter->SetInput (
> currentPointSet );
>
> m_PointSetToCurvedGeometryFilter-
> >SetImageToBeMapped ( image );
>
>
m_PointSetToCurvedGeometryFilter->SetProjectionMode
> (mitk::PointSetToCurvedGeometryFilter::XZPlane );
>
> m_PointSetToCurvedGeometryFilter->Update();
>
>
>
> mitk::GeometryData::Pointer geometryData =
> m_PointSetToCurvedGeometryFilter->GetOutput();
>
>
>
> // Create a node for the curved geometry
>
> mitk::DataNode::Pointer node =
>mitk::DataNode::New();
>
> node->SetData ( geometryData );
>
>
> mitk::PointSetToCurvedGeometryFilter::SetDefaultCurvedGeometryProperti
> es ( node.GetPointer() );
>
>
>
>
>
>
>
> // set image geometry and switch to 2D view
>
> // get renderer
>
>
>
> mitk::BaseRenderer::Pointer
>pMappingRenderer =
> mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4-
> >GetRenderWindow());
>
>
>pMappingRenderer->SetWorldGeometry(geometryData-
> >GetGeometry());
>
> pMappingRenderer-
> >SetMapperID(mitk::BaseRenderer::Standard2D);
>
>
>
> mitk::Geometry2DDataVtkMapper3D::Pointer
>mapper =
> mitk::Geometry2DDataVtkMapper3D::New();
>
>
>
> mapper->SetDataStorageForTexture ( this->GetDataStorage());
>
>
node->SetMapper ( mitk::BaseRenderer::Standard3D,
> mapper );
>
>
>
> this->GetDataStorage()->Add ( node ,
>imageNode );
>
>
>
> node->SetProperty ( "name",
>mitk::StringProperty::New
> ("CMPR" ) );
>
> node->SetColor ( 0.0f, 1.0f, 0.0f );
>
> node->SetVisibility ( true );
>
>
node->SetVisibility( true, m_MultiWidget-
> >GetRenderWindow4()->GetRenderer() );
>
> node->Modified();
>
> node->GetData()->Modified();
>
>
>
void QmitkMyOwnPlugInView::DoImageProcessing()
{
std::vector<mitk::DataNode*> nodes = this->GetDataManagerSelection();
if (nodes.empty()) return;
mitk::DataNode* imageNode = nodes.front();
if (!imageNode)
{
// Nothing selected. Inform the user and return
QMessageBox::information( NULL, "Template", "Please load and select an
image before starting image processing.");
return;
}
// here we have a valid mitk::DataNode
// a node itself is not very useful, we need its data item (the image)
mitk::BaseData* data = imageNode ->GetData();
if (data)
{
mitk::DataNode* PointsNode = this->GetDataStorage ()->GetNamedNode
("aaa");
mitk::PointSet* currentPointSet = 0;
if(PointsNode )
currentPointSet = dynamic_cast<mitk::PointSet*> ( PointsNode
->GetData() );
// test if this data item is an image or not (could also be a surface or
something totally different)
mitk::Image* image = dynamic_cast<mitk::Image*>( data );
if (image && currentPointSet)
{
std::stringstream message;
std::string name;
message << "Performing image processing for image ";
if (imageNode ->GetName(name))
{
// a property called "name" was found for this DataNode
message << "'" << name << "'";
}
message << ".";
MITK_INFO << message.str();
/* mitk::ThinPlateSplineCurvedGeometry */
/********************************************************** */
/*
mitk::ThinPlateSplineCurvedGeometry::Pointer
tpsGeometry = mitk::ThinPlateSplineCurvedGeometry::New();
//Set a reference 3D geometry (e.g. Geometry3D of an
existing image volume)
tpsGeometry->SetFrameGeometry(image->GetGeometry());
// 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)
mitk::PlaneLandmarkProjector::Pointer planeLandmarkProjector
= mitk::PlaneLandmarkProjector::New();
planeLandmarkProjector->SetProjectionPlane(m_MultiWidget->mitkWidget1->GetSliceNavigationController()->GetCurrentPlaneGeometry()
);
// Initialize TPS geometry with projector
tpsGeometry->SetLandmarkProjector(planeLandmarkProjector);
//For rebuilding the TPS surface, call
tpsGeometry->ComputeGeometry();
// Get renderer from widget4 (3D render window)
mitk::BaseRenderer::Pointer m_MappingRenderer =
mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow());
// Get geometry2DData from it and set necessary properties
mitk::DataNode::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));
this->GetDataStorage()->Add ( tpsGeometryDataNode ,
imageNode );
// Set new 2D geometry for this mapper (required for
the Geometry2DDataVtkMapper3D)
m_MappingRenderer->SetWorldGeometry(tpsGeometry);
*/
/*PointSetToCurvedGeometryFilter*/
/******************************************************************/
m_PointSetToCurvedGeometryFilter =
mitk::PointSetToCurvedGeometryFilter::New();
m_PointSetToCurvedGeometryFilter->SetInput (
currentPointSet );
m_PointSetToCurvedGeometryFilter->SetImageToBeMapped (
image );
m_PointSetToCurvedGeometryFilter->SetProjectionMode
(mitk::PointSetToCurvedGeometryFilter::XZPlane );
m_PointSetToCurvedGeometryFilter->Update();
mitk::GeometryData::Pointer geometryData =
m_PointSetToCurvedGeometryFilter->GetOutput();
// Create a node for the curved geometry
mitk::DataNode::Pointer node = mitk::DataNode::New();
node->SetData ( geometryData );
mitk::PointSetToCurvedGeometryFilter::SetDefaultCurvedGeometryProperties (
node.GetPointer() );
// set image geometry and switch to 2D view
// get renderer
mitk::BaseRenderer::Pointer pMappingRenderer =
mitk::BaseRenderer::GetInstance(m_MultiWidget->mitkWidget4->GetRenderWindow());
pMappingRenderer->SetMapperID(mitk::BaseRenderer::Standard2D);
pMappingRenderer->SetWorldGeometry(geometryData->GetGeometry());
mitk::Geometry2DDataVtkMapper3D::Pointer mapper =
mitk::Geometry2DDataVtkMapper3D::New();
mapper->SetDataStorageForTexture (
this->GetDataStorage());
node->SetMapper ( mitk::BaseRenderer::Standard3D,
mapper );
this->GetDataStorage()->Add ( node , imageNode );
node->SetProperty ( "name", mitk::StringProperty::New
("CMPR" ) );
node->SetColor ( 0.0f, 1.0f, 0.0f );
node->SetVisibility ( true );
node->SetVisibility( true,
m_MultiWidget->GetRenderWindow4()->GetRenderer() );
node->Modified();
node->GetData()->Modified();
pMappingRenderer->GetDisplayGeometry()->Fit();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
}
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users