Custom Slicer build - Save button does not bring up "Save Data" widget, does not load NRRD files

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?

SaveSceneandUnsavedData1 SaveSceneandUnsavedData2

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?

Thanks

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;
if (properties[“objectName”].toString().isEmpty())
{
QString name = d->createUniqueDialogName(fileType, action, properties);
properties[“objectName”] = name;
}
qSlicerFileDialog* dialog = d->findDialog(fileType, action);
if (dialog == 0)
{
deleteDialog = true;
qSlicerStandardFileDialog* standardDialog =
new qSlicerStandardFileDialog(this);

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:
“…/Slicer-build/lib/Slicer-4.5/qt-scripted-modules/DICOM.py”
registerDialog: Read “DICOM Directory”

“…/Slicer-build/lib/Slicer-4.5/qt-scripted-modules/DICOMSlicerDataBundlePlugin.py”
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.

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.
Oh. I was under the impression that it is the “NoFile” registration that makes it work. This is what I thought I observed. On the laptop where it does work, “NoFile” is registered along with “Dicom Directory” and “Model File”. Am I mistaken?

Do you really use Slicer-4.5??? That would be very, very old.
Yes it is OLD. This application was built with Kitware’s help (JC and others) in 2016. It was customized to work with Visual Studio 2013 and QT4.8.7. We are not actively working on it. Just in support mode at this time for a client. I do need to follow up with JC as the app will no longer build without manual hacks. The build process was fine last year - the last time I successfully built it was Feb. 2019.

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.