STYLE: Clean up `ImageFileCastWriter::ConvertScalarImage` code
STYLE: Clean up `ImageFileCastWriter::ConvertScalarImage` code

SuperElastix/elastix,SuperElastix/elastix,SuperElastix/elastix,SuperElastix/elastix,SuperElastix/elastix