The interface that I am trying to create will display a open dialog box where the user chooses which image (.dcm) it would like to open and then it should open it in a frameThe code below shows opening the image. The image opens when the image is in the same folder as the source code but I need it to open from a given path
The code you posted does NOT match the description you gave.
That code doesn't open a dialog box. It opens the file whose name is given as a command line argument.
You haven't shown us what command line argument you are using or what result you get.
Post a copy of the exact session showing how that code is called and the results that it produces.