Creat viewer command error

hello,when i use the command “sct_label_utils -i t2.nii.gz -create-viewer 3 -o label_c2c3.nii.gz ”
show me the error as follow

i install it on Ubuntu

Hi @Xujian_Wang,

The error message suggests that there is no available monitor to display the graphical interface.

Are you accessing your Ubuntu machine through a remote connection, such as SSH? If so, that would explain the “Could not connect to display” error message. In that case, you may want to look into “X Forwarding”.

((Explanation: SCT’s -create-viewer uses a GUI, and so if you are running the command remotely on a different server, then you will need to perform some extra steps to have the graphical elements show up on your local machine.))

Kind regards,
Joshua

Thank you very much,Actually,i used the SSH,could you give me some advice about the GUI which SSH is used

As far as advice goes, I would direct you to these two well-written posts:

The only other thing I would say is that the solution may vary depending on which OS you are using for the client and server machines (e.g. Windows → Ubuntu? Ubuntu → Ubuntu? etc.). So if you find that that above instructions don’t work, then you may need to search for OS-specific instructions.

I don’t have much else to add, though, as this is not an SCT-specific issue, but an issue with GUI applications + SSH in general.

Kind regards,
Joshua

1 Like

I will have a try, thank you very much

1 Like