Ticket #9375 (assigned)

Opened 6 years ago

Last modified 5 years ago

SliceViewer cluster display

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: major Milestone: Backlog
Component: Diffraction Keywords:
Cc: Blocked By: #9428, #9469
Blocking: #10647 Tester:

Description

  • Take a peaks workspace integrated via IntegratePeaksUsingCluster
  • Display it in the PeaksOverlay of the SliceViewer
  • This should automatically render with an outline (stencil) view of the clusters

To do this, we must mark the PeaksWorkspaces that have been through IntegratePeaksUsingClusters. This could be done by holding a weak pointer to the MDWorkspace image. It could also be done via some kind of naming + using the ADS. We would then need to make a new PeakOverlayView type, that allowed us to render workspaces of this type.

Change History

comment:1 Changed 6 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Owen Arnold

This could be done with boolean polygon operations http://stackoverflow.com/questions/3501383/find-the-outline-of-a-union-of-grid-aligned-squares. But there is a simpler way where each cluster would iterate over it's labels.

Using the findNeighbours functionality on the neighbours, the cluster could determine if it was sitting on an edge. Infact, this could be done done via a BackgroundStrategy, and would be easy go get working in parallel in terms of clusters. We could and should reduce the overhead, by only considering clusters over-which a peak exists.

For those cells which are on an edge, we would need to record the index in the workspace, as well as the face(s) that make up the edge. Having this work as a separate, algorithm, and perhaps returning a table workspace with the results would be a good option. The SliceViewer code would then need to process the TableWorkspace and build polyhedra corresponding to each cluster.

So I think we need:

  • An algorithm called FindClusterEdges (returning a table workspace)
  • A new PeakOverlayView suitable for drawing Cluster edges
  • A way of binding a PeaksWorkspace to the ClusterWorkspace so that the right PeakOverlayView can be selected via the PeaksWorkspace.

comment:3 Changed 6 years ago by Owen Arnold

Further to above, table workspace would be something like

Cluster Id , MDWorkspace index, Dimension Number, Min or Max 1, 2, 0, True 1, 2, 1, False

Would define a edge against cluster id 1, at workspace index 2, with two edges against dimension 0 and 1, with min on 0 and max on 1.

comment:4 Changed 6 years ago by Owen Arnold

  • Take PeaksWorkspace and ClusterImageWorkspace. This is non trivial. We need a way to associate the two using the PeaksWorkspace as the key.
  • Map PeaksWorkspace onto ClusterImageWorkspace and extract labels of interest. Create Map of Label to Cluster. Could use a Multimap here, and also Key it by PeakNumber as well as LabelId. The cluster should also record it's centre position at this time based on the peak.
  • Iterate over ClusterImageWorkspace Skip over labels that are not of interest, otherwise:
    • Determine the absolute distance to the Cluster centre. Use this to determine an effective radius of the cluster based on it's most remote label
    • In the same iteration as above. Use FindNeighbours as well as a custom BackgroundStrategy to find any unlabelled nearest neighbours. If there are any, mark this in a structure/container(s) local to the Cluster instance. One thing that would be useful to know the orientation of each face. If they were stored according to the dimension in which they have zero-thickness, then it would be possible to quickly determine which faces interact with a slice point. There are various ways and times to do this, but the PeakTransform would really help here.
  • Serialise up all clusters to a single TableWorkspace so that it can be returned from an algorithm.
  • In the SliceViewer code Deserialize the clusters. This will most likely be done via a custom PeakOverlayView and PhysicalClusterPeak type.
  • According to the slice point, call a method on each cluster to return a collection of 2D vertexes that correspond to the SlicePoint position. Something like getVertexesAt(size_t SlicePoint) : Vec<V2D> For this it would be fastest if the clusters had their faces sorted according to the zero-thickness criteria, because those faces parallel to the slice point are not of interest. Only faces perpendicular to the slice point should be considered.
  • In the custom PeakOverlayView, use the vertexes to construct a closed LineSegment to represent in Qt.

comment:5 Changed 6 years ago by Owen Arnold

  • Blocked By 9428 added

comment:6 Changed 6 years ago by Owen Arnold

  • Blocked By 9469 added

comment:7 Changed 6 years ago by Nick Draper

  • Milestone changed from Release 3.2 to Backlog

Moved to Backlog at the code freeze of release 3.2

comment:8 Changed 6 years ago by Owen Arnold

  • Blocking 10647 added

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10218

Note: See TracTickets for help on using tickets.