3d matrix/ pgm files into a brain model

Hi I am completely new to this program. Briefly i will describe what i need. Currently i have a collection of pgm images of the brain that come from mri scans the idea is to create a virtual model of the brain using these images. So far I have been able to put this data into a 3d matrix using java.
I want to know how I can use either this 3d matrix that has all the pgm files, or the pgm files alone, in order to create the model of the brain using 3dslicer please letme know if i am not being clear.
Thanks

Sure, you should be able to do that. Did you try any of the tutorials?