TomographicImaging / CILViewer

A simple Viewer for 3D data built with VTK
Apache License 2.0
8 stars 6 forks source link

Add getVolumeColorPercentiles, getScalarOpacityPercentiles methods etc. #335

Closed lauramurgatroyd closed 1 year ago

lauramurgatroyd commented 1 year ago

Currently we have methods: https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewer.py#L762

https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewer.py#L737

and: https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewer.py#L752

We have getters for the values but not for the percentages. E.g. https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewer.py#L839

But we don't have a method to get the percentages. We should add methods such as:

getVolumeColorPercentiles()

lauramurgatroyd commented 1 year ago

To get the percentages you would currently need to calculate the percentage by using e.g. for the colour range: https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewer.py#L839

And: https://github.com/vais-ral/CILViewer/blob/d1d29f9f3e7d3db180104f9f2446452a50f33bf8/Wrappers/Python/ccpi/viewer/CILViewerBase.py#L219