Skip to content

Source visualization#1031

Open
tontyoutoure wants to merge 10 commits into
OpenGATE:masterfrom
tontyoutoure:source_visualization
Open

Source visualization#1031
tontyoutoure wants to merge 10 commits into
OpenGATE:masterfrom
tontyoutoure:source_visualization

Conversation

@tontyoutoure
Copy link
Copy Markdown
Contributor

Currently it's only working for generic source and it's derived classes, since the GateVSource does not provide methods to generate position sampling.

Docs and tests are also included.

image

@tbaudier
Copy link
Copy Markdown
Contributor

Hello @tontyoutoure

Thank you for your contribution, it's very helpful. I modify a little bit to be able to call the visualization parameters in the way than the other parameters. I let you check the commit and resolve the conflict.

@tontyoutoure
Copy link
Copy Markdown
Contributor Author

@tbaudier I've tested merging into current master branch (commit edac4cd). It generates no conflict now.

@tontyoutoure
Copy link
Copy Markdown
Contributor Author

@tbaudier currently all sources will be defaultly visualized with ("red", 2000, 3). Do you think this is a good idea?

@dsarrut
Copy link
Copy Markdown
Contributor

dsarrut commented May 29, 2026

Very good, thanks @tontyoutoure !

  • Backend : Maybe the "RequestVisualization" and other visualisation related function, should be in the GateVSource base class. What do you think ? Hence, it should work with other type of sources.
  • Frontend : the visualisation options
    source.visualization.count = 2000
    source.visualization.color = "yellow"
    source.visualization.size = 2
    is good from my side. Unsure about the default values, my first guess is that, indeed, we can enabled the source visualisation by default.
  • Tests : does it work with all visualization modes (qt, vrml, gdml ?). If not, we only need to document it.

@tontyoutoure
Copy link
Copy Markdown
Contributor Author

tontyoutoure commented May 29, 2026

@dsarrut I'm not sure moving RequestVisualization into GateVSource is a good idea. Simpling moving it can work, but the current function signature void RequestVisualization(G4int count, py::object color, G4double size); clearly indicate that it's a point cloud, which need position sampling, which GateVSource is not able to do. On the other hand since @tbaudier change the python api from a method of GenericSource to its attributes, I think renaming RequestVisualization into InitializeVisualiztion and call it in InitializeUserInfo is a better idea.

@tontyoutoure
Copy link
Copy Markdown
Contributor Author

@dsarrut I'm sure this don't work under vrml:
image

However I cannot make gdml visualization work on my machine, not even test004_simple_visu_gdml.py, only result in SegFault. Can you test it with test010_generic_source_visu.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants