Hi,
As I have already changed the OnModifiedOutput function because I haver one
personal working are and I needed to show different images in the different
views, my OnModifiedOutput function is like this
try
{
Core::Widgets::RenderWindowContainer* workingArea;
workingArea =
dynamic_cast<Core::Widgets::RenderWindowContainer*>(GetPluginTab()->GetCurrentWorkingArea
() );
//Before changing the active view, be sure that the index is below
the number of views ( GetNumberOfWindows() ).
mitk::DataTreeNode::Pointer node;
Core::CastAnyProcessingData( GetRenderingTree(
)->GetNode(m_Processor->GetOutputDataEntity( 0 ) ), node );
if ( node.IsNotNull( ) && m_Processor->GetOutputDataEntity( 0
)->GetMTime( ) > m_Processor->GetOutputDataEntity( 0 )->GetRenderingData(
"MITK")->GetMTime( ) )
{
node->SetVisibility( false );
node->GetPropertyList( )->DeleteProperty( "levelwindow" );
}
if (workingArea && workingArea ->GetNumberOfWindows() > 0 )
{
if (num<14)
{
workingArea->SetActiveWindow(0);
}
else
{
workingArea->SetActiveWindow(1);
}
}
Core::DataTreeHelper::PublishOutput(m_Processor->GetOutputDataEntityHolder(
num ), GetRenderingTree(), false, false );
//Core::DataTreeHelper::PublishOutput(m_Processor->GetOutputDataEntityHolder(
0 ), GetRenderingTree( ) );
}
coreCatchExceptionsReportAndNoThrowMacro("ResamplePanelWidget::OnModifiedInput"
);
I don't know if I have done something wrong as it doesn't work as I hope.
I also haven't really understood this part you mentioned:
Once the UpdateOutput() is called from your processor, and before adding
your data to the rendering tree, remove the property "levelwindow" from the
rendering node.
What must I do in the code to achieve this?
Thank you very much
Aida
2012/8/29 Xavi Planes <[email protected]>
> Hi Aida,
>
> I found an easier method to get what you need. Once the
> UpdateOutput() is called from your processor, and before adding your
> data to the rendering tree, remove the property "levelwindow" from the
> rendering node. Then, the level window property will be computed again
> automatically:
> 1. In your panel widget, you need to disable the default output
> processor observer (if any):
>
> void SandboxPlugin::ResamplePanelWidget::OnInit( )
> {
> if ( GetProcessorOutputObserver( 0 ).IsNotNull( ) )
> {
> GetProcessorOutputObserver( 0 )->SetEnable( false );
> }
> }
>
> 2. In your panel widget, you need to overwrite the function
> OnModifiedOutput():
>
> void SandboxPlugin::ResamplePanelWidget::OnModifiedOutput( int num )
> {
> try
> {
> mitk::DataTreeNode::Pointer node;
> Core::CastAnyProcessingData( GetRenderingTree( )->GetNode(
> m_Processor->GetOutputDataEntity( 0 ) ), node );
> if ( node.IsNotNull( ) &&
> m_Processor->GetOutputDataEntity( 0 )->GetMTime(
> ) >
> m_Processor->GetOutputDataEntity( 0 )->GetRenderingData( "MITK"
> )->GetMTime( ) )
> {
> node->SetVisibility( false );
> node->GetPropertyList( )->DeleteProperty(
> "levelwindow" );
> }
> Core::DataTreeHelper::PublishOutput(
> m_Processor->GetOutputDataEntityHolder( 0 ), GetRenderingTree( ) );
> }
> coreCatchExceptionsReportAndNoThrowMacro(
> "ResamplePanelWidget::OnModifiedInput" );
> }
>
> Best regards,
> Xavi
>
> 2012/8/28 Aida Ninyerola <[email protected]>:
> > Yes! That was what I was trying to describe.
> >
> > Thanks for the explanation.
> >
> > In my processor, each time my image is computed the UpdateOutput
> function is
> > called like this
> > UpdateOutput(count,imageSuma , "ColapsedImage", true, 1, NULL, metaData);
> > where previously to metaData I added the Modality tag.
> >
> > In order to adjust the level window automatically, what must I do to the
> > metadata information?
> > Is it necessary to calculate the maximum and minimum of the image and
> update
> > the metada information?
> >
> > Thank you very much
> > Aida
> >
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gimias-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gimias-developers