I have a CT scan of a portion of a human body, with each point describing density. The data file provides X, Y, Z, and density values. I want to know how to visualize this data, using OpenGL or a library based on OpenGL.
What you're looking for is "volumetric rendering", here is one resource with code that takes data in the form of images of the layers:
A quick hack would be to use a grid of particles/"billboards", and make them transparent based on the density.
There are many methods to go about visualizing volume data. Two famous ones are texture slices and ray marching. Texture slices intends to render 3D textures with volume data. Refer to the wiki page for Volume Rendering for more approaches. Ray marching shoots rays through the volume and composites values as the ray progresses through. This is a very simple explanation.
Now you can code raymarching in a fragment shader or a compute shader or even on the cpu. If you are interested in Raymarching, you can use my project as a reference (I used a compute shader approach) https://github.com/gallickgunner/Volume-Renderer
Also these tutorials might come in handy.
For an in-depth explanation to these topics, refer to the book "Real time Volume Graphics"