-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add qt to vtk image #882
Add qt to vtk image #882
Conversation
A QImage may not be RGBA, it has multiple pixel formats. |
Alternatively, you may want to use vtkQImageToImageSource |
I've tried to use vtkQImageToImageSource first. First problem was that the filter was not wrapped by VTK's Python wrapper. I've tried to add a wrapping around it from CTK, but it turned out it was not included in VTK_LIBRARIES. Instead of blindly adding one more dependency, I had a look at the vtkQImageToImageSource implementation and realized that the filter is overcomplicated and the operation can be implemented in a few lines of code and so it is not worth using vtkQImageToImageSource. |
Fair enough |
We call |
That's good with me then. |
Do you plan to replace the corresponding code that's already in Slicer? |
I've added this new function because I did not find it in Slicer (the closest was the one in CTK, which only provided conversion in the other direction). I think it makes sense to have the feature available at the lowest-level library (and use that in higher-level libraries). So, I would move the best implementation of the converters to CTK and use that from qMRMLUtils. |
Allows converting Qt image to VTK image. Also added test for qImageToVTKImageData and vtkImageDataToQImage.
Get database folder settings key from ctkDICOMBrowser::defaultDatabaseDirectorySettingsKey().
f260a9e
to
5f6bf67
Compare
Thanks for the reviews. I've consolidated with the implementations in Slicer, added a test, and merged. |
Add utility function to convert Qt image to VTK image and fix a few Python wrappings.