elastix icon indicating copy to clipboard operation
elastix copied to clipboard

TransformixFilter should _not_ automatically do `this->SetOutputDirectory(".")`

Open N-Dekker opened this issue 2 years ago • 0 comments

Users may leave the output directory path empty, which is usually an indication that no output is written, However when ComputeSpatialJacobian, ComputeDeterminantOfSpatialJacobian, ComputeDeformationField, or FixedPointSetFileName are set, TransformixFilter will still try to write to the current directory.

TransformixFilter<TImage>::GenerateData() does:

https://github.com/SuperElastix/elastix/blob/c47889a50bc5e92d6712c9d9d4e8576993329602/Core/Main/itkTransformixFilter.hxx#L112-L117

It may be a deliberate choice to not write to an output directory. So TransformixFilter should not do this->SetOutputDirectory("."). Instead I think it would be better if it would just produce a warning message, like:

Output directory not specified. Unable to write SpatialJacobian, DeterminantOfSpatialJacobian, DeformationField, or FixedPointSet to file.

What do you think?

N-Dekker avatar Jun 23 '23 13:06 N-Dekker