Edit default dicom import directory

hello to all 3dslicer fans!

I use slicer 5.8.1 on PC Windows 10 pro

I use “import dicom” very often.

unfortunately the “Import DICOM files from directory” window always open in the same folder:

C:\Users\7064654\AppData\Local\slicer.org\Slicer 5.8.1

I want to edit the default pathway into the other folder where I store all my dicoms.

Sure, I could create a shortcut, but I would like something more straightforward.

I looked on:

  • 3dslicer App Settings “General” or “Dicom”: no solution
  • chatgpt: no good solution
  • 3dslicer forums: no solution.

Does anyone have an idea?

thanks for help!

mathieu

In all the apps I develop, I store tha last used directory in application settings (QSettings, i.e. the Slicer.ini file). It would be quite easy to add this to the DICOM import.

dear csaba pinter,

many thx for answer!!

unfortunately, i m not sure i understand well:

you mean that i could create an app or modify (like python programming) an existing app? that is above my competences.

I asked if there was an easy way to do this in settings.

if there is no easy way, the shortcut inside the default folder is an easier way to achieve goal.

MANY THX indeed for your time! i appreciate!

mathieu

What I said is that the developers could add this feature simply.

I don’t think there is any setting exposed for this.

It could be that this directory shortcut available in the Import DICOM dialog box is handled by Qt itself.

On Linux, my Slicer startup script edits $HOME/.config/QtProject.conf to add a few directories to the shortcut key. Then the above mentioned dialog box shows the edited shortcuts.

But there’s a caveat. If just after starting Slicer, the Add data/Choose file(s) to add dialog box is raised, the shortcuts in that configuration file get overwritten to $HOME.

The workaround is good enough for me, your’s would be good enough for you. A general solution would be nice indeed, I have no idea if it’s Qt or application related.

+1 for remembering a last-used import directory for DICOM import. That would be a nice quality of life improvement.

If someone is working on this, it would also be nice to remember the recently used dicom database locations too.

1 Like

@pieper What do you mean exactly? We already start navigating to select a new database from the location of the current one. Do you suggest opening a new dialog offering the last N database paths?

We just did the “saving the last imported DICOM directory” part, but this request needs clarification before we issue a PR. Thanks!

Hi @cpinter - What I often do is create a ‘dicom database per project’. For example, I get some data for multiple patients for research or I download a collection from IDC. Then I’ll want to switch Slicer between databases to as I work on various projects. Currently I use the directory browser to pick the dicom database folder for the project, but I need to remember and find the database directory manually. It would be great if there were a list of recent directories stored in the settings and available in a pull aside menu of the dicom module to simplify this workflow.

1 Like

There is a PR for these two changes: ENH: Last used DICOM import and 10 last used database directories are stored by xskere · Pull Request #8843 · Slicer/Slicer · GitHub

1 Like

I hope the changes in the PR are what were on your mind!