These are chat archives for glue-viz/glue-vispy-viewers

1st
May 2016
Penny Qian
@PennyQ
May 01 2016 20:14

@astrofrog I am trying to implement the dendrogram selection in Volume Viewer as point mode, the main idea is passing the max_pos to dendrogram and get the selected mask from dendrogram.structure_at() and then pass the mask to draw, as the code shown below. While I don’t know how to get the dendrogram structure under current glue_vispy_viewers directory, I am thinking using DataCollection but this might also requires some judgements for the Dendrogram file, so can you show me how to do it? Thanks!

def on_mouse_press(self, event):
...
max_pos = self.get_max_pos() # the voxel pos along ray casting line when clicking the mouse
dendro = Dendrogram.load_from('dendrogram.fits’)
substructure = dendro.structure_at((max_pos[0], max_pos[2], max_pos[1]))
dendro_mask = substructure.get_mask(shape=np.transpose(self.trans_ones_data).shape)
self.mark_selected(dendro_mask, current_layer)