An apparatus for generating a magnetic field for tracking of an object can include a localized magnetic field generator that is configured to generate a magnetic field and to control the magnetic field in an area of interest and configured to control the magnetic field in a separate area. The separate area can be displaced from the area of interest and can include a magnetic field-disrupting component. The object can be located in the area of interest.