Open pberkes opened 9 years ago
Can this be thought of as a generalization of the volume masking feature?
@pberkes The implementation details have changed. Please refer to https://github.com/enthought/ensemble/pull/48.
We have a VolumeFilter
class which has a filter
method to transform the volume data's raw_data
.
VolumeData
has a VolumeFilter
instance, which when set will apply the transform on the `raw_data1.
@jwiggins it could, but we will want to filter (including transforming the values) and mask (e.g. with the cylindrical mask) at the same time
@jwiggins @pberkes Looking at _prepare_data
(https://github.com/enthought/ensemble/blob/add-data-filters/ensemble/volren/volume_data.py#L143), this could be the possible refactors:
_image_data_from_array
with spacing
attribute._resample_data
_apply_mask
with mask_data
attribute. MaskFilter will also have an ImageFilter instance as _apply_mask
uses _image_data_from_array
.Also the above refactors seem to point to VolumeFilter as just a data transformation filter, more suitably named DataFilter
if one were to implement as above.
OTOH, I think all this is an overkill? Thoughts?
While I see the appeal of having a whole visualization pipeline, I do think that it would be overkill given what we are trying to accomplish: given resampled, masked data, we want the user to be able to use different filters to color the result.
What do you mean by "color the result"? The color is being generated by the transfer function.
Bad wording: what I mean is that the content of the histogram and the displayed values are from the filtered data.
We need to add a "Color by:" dropbox on the histogram that controls what is displayed in the histogram and the 3D viewer. By default, the dropbox is going to contain "CT" (i.e., the original data).
Values in the dropbox are given by a list of
Filter
objects that have a name (to be displayed in the dropbox) and a function,filter
, that takes the 3D volume data and return a new 3D array with the same shape and potentially new data.The output of the
Filter
object is used to compute a new histogram, and to update the content of the 3D view.Things we need to care about:
The dropbox responds to changes to the list of filtersFilters
have anupdated
Event
trait; the histogram listens to that trait and when it is fired it calls the filter again to recompute its outputVolumeData
VolumeFilter
subclass. See: https://github.com/enthought/ensemble/issues/46#issuecomment-147073792