# ImageBase SetDirection API Change

Bill Lorensen
2013-11-11
The signature for SetDirection has changed from SetDirection(const DirectionType direction) to SetDirection(const DirectionType &amp direction). The change was made to ImageBase and ImageAdaptor. Any classes that derive from ImageBase will also need to be changed.

The changes were suggested by Coverity. The Coverity error is: COMP: Big parameter passed by value CID 1106765 Big parameter passed by value Copying large values is inefficient, consider passing by reference; size thresholds for detection can be adjusted. In itk::​ImageBase&amp;lt;5u&gt;::​SetDirection(itk::​Matrix&amp;lt;double, 5u, 5u&gt;): A large function call parameter or exception catch statement is passed by value

NOTEs: ImageAdaptor also needed the change since it derives from ImageBase. Other Set methods in ImageBase already passed their rguments by reference.

SetDirection(const DirectionType direction)
SetDirection(const DirectionType &ampdirection)
I94621042013ab9a8a814ba4759aa08c42d135f49
Modules/Core/Common/include/itkImageBase.h Modules/Core/Common/include/itkImageBase.hxx Modules/Core/ImageAdaptors/include/itkImageAdaptor.h Modules/Core/ImageAdaptors/include/itkImageAdaptor.hxx