Skip to content

Conversation

fbudin69500
Copy link

ViewImage class can be called using its static function View if
the user does not need to keep track of the ViewImage object.
However, in some case, the user needs to keep track of the object
and can now use the class through the typical ITK pointer interface.
Using this interface, the user has the extra option to set
the render window interactor.

`ViewImage` class can be called using its static function `View` if
the user does not need to keep track of the `ViewImage` object.
However, in some case, the user needs to keep track of the object
and can now use the class through the typical ITK pointer interface.
Using this interface, the user has the extra option to set
the render window interactor.
@fbudin69500 fbudin69500 requested a review from thewtex January 25, 2019 13:16
@fbudin69500
Copy link
Author

Needs some cleanup, but it works on my computer.

@fbudin69500 fbudin69500 requested a review from phcerdan January 25, 2019 13:18
@phcerdan
Copy link
Collaborator

phcerdan commented Jan 25, 2019

Cool!
Have you tested that the interactor is the only thing you need? Or you need to expose more, like the RenderWindow, etc? I am not sure what owns what in VTK.

BTW, we can create a free-function for usage in c++ code.

namespace itk {
template<TImage>
void View(TImage * image, ...)
  {
  ViewImage<TImage>::View(image, ...)
  }
}

That will allow to call it without the need of template specification --it will be deduced. This comes handy in cpp and it was the intention of the original design (I put it in a class for wrapping purposes). What do you think about the name of this free function, should be View or too generic? should be in namespace itk::utils::View? Sorry, maybe that's another topic...

Looking good!

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! LGTM 👍

@thewtex
Copy link
Member

thewtex commented Jan 25, 2019

@phcerdan View sounds great! We should construct it to accept 1 or more DataObject's so it also support viewing other ITK data types. If multiple are passed, all VTK actors could be added to the same RenderWindow ... which will be possible with this patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants