ITKElastix icon indicating copy to clipboard operation
ITKElastix copied to clipboard

Feature: Write log to file without writing transform parameters

Open Svdvoort opened this issue 2 years ago • 3 comments

Currently, in order to write the log to file you need to do the following:

elastix_object = itk.ElastixRegistrationMethod[itk.Image[itk.F, 3], itk.Image[itk.F, 3]].New()
elastix_object.SetLogToFile(True)
elastix_object.SetLogFileName("out.log")
elastix_object.SetOutputDirectory("/data/")

However, by using elastix_object.SetOutputDirectory, the transform parameter file will also automatically be written to the specified output directory. I am already saving the transform parameter file separately (after manipulating it a bit ), so having it written to file without explicitly asking Elastix is confusing and clutters up folders.

Ideally, something like this would be sufficient, as it would be clear then that only the log file is written:

elastix_object = itk.ElastixRegistrationMethod[itk.Image[itk.F, 3], itk.Image[itk.F, 3]].New()
elastix_object.SetLogToFile(True)
elastix_object.SetLogFileName("/data/out.log")

However, explicitly setting that the transform parameter file should not be written is also a solution:

elastix_object = itk.ElastixRegistrationMethod[itk.Image[itk.F, 3], itk.Image[itk.F, 3]].New()
elastix_object.SetLogToFile(True)
elastix_object.SetLogFileName("out.log")
elastix_object.SetOutputDirectory("/data/")
elastix_object.SetWriteTransformParameters(False)

Svdvoort avatar Aug 17 '22 14:08 Svdvoort

CC @N-Dekker

thewtex avatar Aug 24 '22 19:08 thewtex

@N-Dekker has our logging options improved with 0.16.0, or will the spdlog related support be finalized in a future release?

thewtex avatar Feb 15 '23 10:02 thewtex

@thewtex Sorry, ITKElastix 0.16.0 based on elastix library release 5.1.0 does not yet have extra logging options. To be added in a future release!

N-Dekker avatar Feb 15 '23 11:02 N-Dekker