Parameter do not exist warning

Hi all,

I have a script for automating scalar volume resampling:

reslicedVolumeNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLScalarVolumeNode", name)
    parameters = {
        "outputPixelSpacing":"{:},{:},{:}".format(*[resolution]*3),
        "InputVolume":volumeNode.GetID(),
        "interpolationMode":'bspline',
        "referenceVolume": volumeNode.GetID(),
        "OutputVolume":reslicedVolumeNode.GetID()}
    
    cliNode = slicer.cli.runSync(slicer.modules.resamplescalarvolume, None, parameters)

After many experiments, I discovered that the parameter interpolationMode should actually be interpolationType. However, no error or warning is displayed, so I was unintentionally using the default ‘linear’ interpolation instead of ‘bspline’. Is it possible to implement a warning message to help avoid this kind of mistake? It was quite difficult to debug.
I guess that the same happens with other modules as well.

Many thanks.

I think that your request cannot be fulfilled (by the relevant developer).

You are basically passing a arbitrary field ‘interpolationMode’ that the reader is not looking for. Unless it checks all keys, it won’t react to unknown inputs. It’s doubtful developers would add an overhead to their code.

If someone else passes in a key type of - “Greetings” : ‘Coucou’ - why should the reader check for this key?

Check available keys and values in 'lib/Slicer-5.7/cli-modules/ResampleScalarVolume.xml
'.