load obj file with Vtkobjreader giving relative path

Hi ,

I was trying to load obj file using VtkobjectReader in C++
While loading a obj with SetFileName if I give a full path of the obj, it works. However, I would like to load that file with relative path because I am in debug mode of 3D slicer. Any suggestions ?

Thank you !!

You can use relative path in a small command-line application, but in a large GUI application many components may change the current working directory, therefore I would always recommend to use absolute paths. If you know what is the working directory then you can easily convert relative paths to absolute paths and pass that to 3D Slicer or VTK.