How can I volume render a segment ?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I volume render a segment ?

tarun14110
Instead of creating surface, I just want to directly render the segmented
volume. I am using segment editor in my module for segment. I want to
display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display
properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a
vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was
provided./
`



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

pinter
Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba

-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

tarun14110
In reply to this post by tarun14110
I am creating python module. Can you please show me some basic code, such that it makes labelmap of all segments and display those in 3d volume ?

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter <[hidden email]> wrote:
Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba

-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
Regards,
Tarun kumar yadav
B.Tech 3rd year (CSE)

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

tarun14110
In reply to this post by tarun14110
I am trying to export using
slicer.modules.segmentations.logic().ExportSegmentsToLabelmapNode(getNode('Segmentation'), None, getNode('Labelmap'), getNode('Reference'))

But not able to do that.
Can someone please explain the basic code to export all segments in labelmap and then also display that labelmap into 3d view ?

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter <[hidden email]> wrote:
Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba

-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ



--
Regards,
Tarun kumar yadav
B.Tech 3rd year (CSE)

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

lasso2

Volume rendering visualizes binary segmentation results very poorly – compared to segmentation module’s built-in surface rendering. See the attached image: left is surface rendering, right is volume rendering.

 

If you want to give it a try, create labelmap using Segmentations module, “Export/Import segments” section.

 

If after all this you still want to create merged labelmaps from Python scripts then you have to write us what error message do you get when you run your script. Simply writing “But not able to do that“ is not helpful at all.

 

Andras

 

From: slicer-devel [mailto:[hidden email]] On Behalf Of Tarun Kumar Yadav
Sent: April 6, 2017 8:07
To: Csaba Pinter <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] How can I volume render a segment ?

 

I am trying to export using
slicer.modules.segmentations.logic().ExportSegmentsToLabelmapNode(getNode('Segmentation'), None, getNode('Labelmap'), getNode('Reference'))

But not able to do that.

Can someone please explain the basic code to export all segments in labelmap and then also display that labelmap into 3d view ?

 

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter <[hidden email]> wrote:

Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba


-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ




--

Regards,

Tarun kumar yadav

B.Tech 3rd year (CSE)


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ

Segmentation-Surface_Vr.png (321K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

lasso2
In reply to this post by tarun14110
With upcoming volume rendering improvements (multi-volume rendering and built-in smoothing) in VTK 8, volume rendering may have a role in segmentation visualization, but probably you need to wait a year or so.

Andras

From: Andras Lasso
Sent: Thursday, April 6, 2017 8:58 AM
To: Tarun Kumar Yadav; Csaba Pinter
Cc: SPL Slicer Devel
Subject: Re: [slicer-devel] How can I volume render a segment ?




Volume rendering visualizes binary segmentation results very poorly – compared to segmentation module’s built-in surface rendering. See the attached image: left
 is surface rendering, right is volume rendering.
 
If you want to give it a try, create labelmap using Segmentations module, “Export/Import segments” section.
 
If after all this you still want to create merged labelmaps from Python scripts then you have to write us what error message do you get when you run your script.
 Simply writing “But not able to do that“ is not helpful at all.
 
Andras
 


From: slicer-devel [mailto:[hidden email]]
On Behalf Of Tarun Kumar Yadav
Sent: April 6, 2017 8:07
To: Csaba Pinter [hidden email]
Cc: SPL Slicer Devel [hidden email]
Subject: Re: [slicer-devel] How can I volume render a segment ?


 


I am trying to export using

slicer.modules.segmentations.logic().ExportSegmentsToLabelmapNode(getNode('Segmentation'), None, getNode('Labelmap'), getNode('Reference'))


But not able to do that.


Can someone please explain the basic code to export all segments in labelmap and then also display that labelmap into 3d view ?



 

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter [hidden email] wrote:

Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba



-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel [hidden email]
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context:
http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ







--












Regards,


Tarun kumar yadav


B.Tech 3rd year (CSE)

















_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

tarun14110
In reply to this post by tarun14110
I got that. I am also having issue while trying to display the 3d volume of the segments using surface rendering. Can you please show me code to show all segments in 3d volume using surface rendering ?

On Thu, Apr 6, 2017 at 6:34 PM, Andras Lasso <[hidden email]> wrote:
With upcoming volume rendering improvements (multi-volume rendering and built-in smoothing) in VTK 8, volume rendering may have a role in segmentation visualization, but probably you need to wait a year or so.

Andras

From: Andras Lasso
Sent: Thursday, April 6, 2017 8:58 AM
To: Tarun Kumar Yadav; Csaba Pinter
Cc: SPL Slicer Devel
Subject: Re: [slicer-devel] How can I volume render a segment ?




Volume rendering visualizes binary segmentation results very poorly – compared to segmentation module’s built-in surface rendering. See the attached image: left
 is surface rendering, right is volume rendering.
 
If you want to give it a try, create labelmap using Segmentations module, “Export/Import segments” section.
 
If after all this you still want to create merged labelmaps from Python scripts then you have to write us what error message do you get when you run your script.
 Simply writing “But not able to do that“ is not helpful at all.
 
Andras
 


From: slicer-devel [mailto:[hidden email]]
On Behalf Of Tarun Kumar Yadav
Sent: April 6, 2017 8:07
To: Csaba Pinter [hidden email]
Cc: SPL Slicer Devel [hidden email]
Subject: Re: [slicer-devel] How can I volume render a segment ?


 


I am trying to export using

slicer.modules.segmentations.logic().ExportSegmentsToLabelmapNode(getNode('Segmentation'), None, getNode('Labelmap'), getNode('Reference'))


But not able to do that.


Can someone please explain the basic code to export all segments in labelmap and then also display that labelmap into 3d view ?



 

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter [hidden email] wrote:

Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba



-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel [hidden email]
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context:
http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ







--












Regards,


Tarun kumar yadav


B.Tech 3rd year (CSE)




















--
Regards,
Tarun kumar yadav
B.Tech 3rd year (CSE)

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: How can I volume render a segment ?

lasso2
In reply to this post by tarun14110

Show segments in 3D:

slicer.util.getNode('Segmentation').CreateClosedSurfaceRepresentation()

 

See more examples here:

https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Segmentations

 

Andras

 

From: Tarun Kumar Yadav [mailto:[hidden email]]
Sent: April 6, 2017 18:51
To: Andras Lasso <[hidden email]>
Cc: Csaba Pinter <[hidden email]>; SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] How can I volume render a segment ?

 

I got that. I am also having issue while trying to display the 3d volume of the segments using surface rendering. Can you please show me code to show all segments in 3d volume using surface rendering ?

 

On Thu, Apr 6, 2017 at 6:34 PM, Andras Lasso <[hidden email]> wrote:

With upcoming volume rendering improvements (multi-volume rendering and built-in smoothing) in VTK 8, volume rendering may have a role in segmentation visualization, but probably you need to wait a year or so.

Andras

From: Andras Lasso
Sent: Thursday, April 6, 2017 8:58 AM
To: Tarun Kumar Yadav; Csaba Pinter
Cc: SPL Slicer Devel

Subject: Re: [slicer-devel] How can I volume render a segment ?




Volume rendering visualizes binary segmentation results very poorly – compared to segmentation module’s built-in surface rendering. See the attached image: left
 is surface rendering, right is volume rendering.
 
If you want to give it a try, create labelmap using Segmentations module, “Export/Import segments” section.
 
If after all this you still want to create merged labelmaps from Python scripts then you have to write us what error message do you get when you run your script.
 Simply writing “But not able to do that“ is not helpful at all.
 
Andras
 


From: slicer-devel [mailto:[hidden email]]
On Behalf Of Tarun Kumar Yadav
Sent: April 6, 2017 8:07
To: Csaba Pinter [hidden email]
Cc: SPL Slicer Devel [hidden email]
Subject: Re: [slicer-devel] How can I volume render a segment ?


 


I am trying to export using

slicer.modules.segmentations.logic().ExportSegmentsToLabelmapNode(getNode('Segmentation'), None, getNode('Labelmap'), getNode('Reference'))


But not able to do that.


Can someone please explain the basic code to export all segments in labelmap and then also display that labelmap into 3d view ?



 

On Wed, Apr 5, 2017 at 8:42 PM, Csaba Pinter [hidden email] wrote:

Hi,

Segmentation node is not a volume node. If you want to volume render it, then you'll need to export the segment(s) to a labelmap volume. You can do it using vtkSlicerSegmentationsModuleLogic::ExportSegmentsToLabelmapNode

csaba



-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of tarun14110
Sent: Wednesday, April 5, 2017 09:01
To: SPL Slicer Devel [hidden email]
Subject: [slicer-devel] How can I volume render a segment ?

Instead of creating surface, I just want to directly render the segmented volume. I am using segment editor in my module for segment. I want to display 3d volume(using volume rendering) of segment.
I tried below code.

        `/logic = slicer.modules.volumerendering.logic()
        segmentationNode = getNode('Segmentation')
        displayNode = segmentationNode.GetDisplayNode()
        displayNode.SetAllSegmentsVisibility3D(False)
        segmentID = segmentationNode.GetSegmentation().GetNthSegmentID(0)
        displayNode.SetSegmentVisibility3D(segmentID, True)
        displayNode.SetSegmentOpacity3D(segmentID, 0.2)
        slicer.mrmlScene.AddNode(displayNode)
        displayNode.UnRegister(logic)
        logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
        segmentationNode.AddAndObserveDisplayNodeID(displayNode.GetID())/`

But getting error

`/Warning: In
/home/kitware/Dashboards/Nightly/Slicer-0/Libs/MRML/Core/vtkMRMLSegmentationDisplayNode.cxx,
line 297
vtkMRMLSegmentationDisplayNode (0x6dcdee0):
vtkMRMLSegmentationDisplayNode::GetSegmentDisplayProperties: no display properties are found for segment ID=Segment_2, return default


Traceback (most recent call last):
  File
"/home/mafia/Desktop/InteractiveSegment/InteractiveSegmentation/InteractiveSegmentation.py",
line 1253, in display3dview
    logic.UpdateDisplayNodeFromVolumeNode(displayNode, segmentationNode)
TypeError: UpdateDisplayNodeFromVolumeNode argument 1: method requires a vtkMRMLVolumeRenderingDisplayNode, a vtkMRMLSegmentationDisplayNode was provided./ `



--
View this message in context:
http://slicer-devel.65872.n3.nabble.com/How-can-I-volume-render-a-segment-tp4038424.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to
[hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ







--












Regards,


Tarun kumar yadav


B.Tech 3rd year (CSE)



















--

Regards,

Tarun kumar yadav

B.Tech 3rd year (CSE)


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ