I am working with a custom Slicer based application that Kitware helped us develop 2 years ago.
I built our custom Slicer-based application on one laptop. But the application does not behave correctly on this laptop. It will not load NRRD files or FCSV files. However, it is able to load a DICOM series and display it correctly. Another peculiarity is that when I click the “Save” button, it just brings up a standard Windows save dialog - not the Qt “Save Data” widget.
As a test, I created an installer for this application on this laptop. (It is something Kitware provided too). When I installed it on a different laptop using this installed .exe file, everything works normally - NRRD and FCSV files load properly, the Save button brings up the expected “Save Data” widget.
I have attached screenshots of the dialog boxes that pop up on the two laptops.
I am baffled. Any idea what is going on here?
Probably a custom module overrides default save and load data behavior.
When I created a .exe installer on the laptop where I am seeing this issue - and then use that installer to install the same application on a different laptop, it behaves normally on the second laptop. That is what is baffling me.
I could try stepping through the code in Visual Studio - to trace what is happening when I click the “Save” button. Which files should I set breakpoints at? I think it is under:
Slicer-build/Base/QTGUI/moc_qSlicerSaveDataDialog_p.cxx. Is this correct?
Probably you have a custom module/extension installed on the laptop where you see this issue. Check if anything is listed under “Additional module paths” (in Application settings / Modules).
I checked Application Settings. The “Additional module paths” is empty.
I sent the installer over to our client. They were able to install it and it works normally on their side. So the issue is specific to this one laptop where I built the application and created the installer.
Any other suggestions? Will stepping through the code shed some light? What files are involved when the Save button is clicked?
I used the Visual Studio Debugger to trace what is going on. This is what I traced when I clicked the “Data” button in our custom Slicer build. The standard FileDialog pops up instead of the Slicer Data Widget. This is another of the issues I have with our custom build - similar to what happens when I click the “Save” button. I discovered the the Slicer code does indeed bring up the standard dialogs in some cases of failure.
The issue comes from …\Slicer\Base\QTGUI\qSlicerIOManager.cc
bool qSlicerIOManager::openDialog(qSlicerIO::IOFileType fileType,…)
bool deleteDialog = false;
QString name = d->createUniqueDialogName(fileType, action, properties);
properties[“objectName”] = name;
qSlicerFileDialog* dialog = d->findDialog(fileType, action);
if (dialog == 0)
deleteDialog = true;
qSlicerStandardFileDialog* standardDialog =
So the issue arises from the findDialog() method. On the laptop where I am having this issue, findDialog() returns NULL causing the standardDialog to pop up instead? I do not know why yet - but thought I would share it with you hoping for answers. I am not familiar with Qt.
Nice work, just continue along these lines. Step into findDialog, see what fileType you get, what qSlicerFileDialog classes are registered, etc. The default save dialog is qSlicerSaveDataDialog, registered in qSlicerDataModule. If that is not found then it is either not registered or later removed or overridden by another one. Even a scripted module can override the default save dialog (look for “FileDialog” in all .py files).
I continued debugging. On the laptop where the code works, I noticed the following:
registerDialog: Read “DICOM Directory”
registerDialog: Read “NoFile”
registerDialog: Write “NoFile”
So after the DICOMSlicerDataBundlePlugin.py module is processed, “NoFile” gets registered (for both Read and Write).
On the laptop where it fails, “NoFile” does not get registered. The only registered dialogs are “DICOM Directory” and “ModelFile” (added when Editor.py is processed)
So when I click the “Data” button, it looks for the “NoFile” dialog but does not find it. So it pops up the default dialog.
I can dig further. But I thought I would check if you had a quick answer or suggestion. Could be the Antivirus software preventing something from being loaded? I have Traps running and it has been blocking certain modules.
Thanks so much.
Probably you have a stray .py or .pyc file somewhere that registers this NoFile (scene) read/write plugins. Maybe it is the DICOMSlicerDataBundlePlugin. Try to delete that file and see if you still get the extra dialog registrations.
Do you really use Slicer-4.5??? That would be very, very old.
NoFile is the scene save dialog. Normally you have only one plugin that registers as NoFile: the standard save dialog. It seems that you have another one, which registers itself as NoFile, replacing the standard save dialog.