BrutPitt / glChAoS.P

3D GPUs Strange Attractors and Hypercomplex Fractals explorer - up to 256 Million particles in RealTime
https://michelemorrone.eu/glchaosp
BSD 2-Clause "Simplified" License
786 stars 61 forks source link

Fractals for medical imaging #9

Open chrisfoulon opened 1 year ago

chrisfoulon commented 1 year ago

Dear Michele,

I am a postdoc working at the University College of London in collaboration with the NHS and King's College. We are looking for a way to generate a dataset of 3D fractal images to use with brain imaging to help train machine-learning models. We found your tool and were amazed by your images! We were wondering whether there is a way to generate grayscale point clouds with a given resolution using your tools. The images that we use are generally 91 x 109 x 91 in grayscale (well, each voxel contains one number that we generally visualise in grayscale).

I don't know if your tool is already able to do that or if it would require some tweaking. I haven't done much of C++, but I might be able to make changes if I know where to look :).

Thank you for your fantastic tool and your help! Chris Foulon.

BrutPitt commented 1 year ago

Hi @chrisfoulon Forgive me for replying late, and thanks for appreciations.

Currently glChAoS.P generates a point cloud of coordinates X,Y,Z,W, were X,Y,Z are spatial coordinates of point and W (generally) is the distance from previous point (point speed): the W value (lastly) is used as index in the color palette. But also, for example, in DLA3D,, the W value calculates the distance of current point from center of Cartesian axes p(0,0,0) (and not from previous point) Thus, we can say, that glChAoS.P already generate grayscale point cloud: the colors are dynamically generates from a normalized W value used as index.

The resolution is also completely customizable, obviously you need to set the correct camera position (according to OpenGL / WebGL specification) and dot size (is not automatic). (also near and far clipping planes: frustrum)

That said, the simplest way to visualize point clouds would be to create a PLY file (ASCII or binary are both OK) from your volumetric image, XYZ and RGB values are enough (for grayscale you can reply same value in the RGB triplet), and load it in glChAoS.P from DATA menu (just to view the result) *DATA menu is available only on desktop release of glChAoS.P, not in WebGL version So you could develop this small conversion program in your preferred programming language (there are many PLY libraries for any language)

Or if you already have clear ideas, I can guide you directly in programming of glChAoS.P(derive a C ++ class with your algorithm) But you will have to tell me more about the algorithm in question: there are different sub classes depending on the input parameters and the output formatting.

Best regards, Michele