A method for compensating in a space volume for a magnetic noise field
outside the space volume includes determining a strength of the magnetic
noise field outside the space volume; defining a correlation between the
noise field outside the space volume and a corresponding noise field
inside the space volume, or calculating the noise field inside the space
volume on the basis of the measurements of the magnetic field outside the
space volume; based on the noise field inside the space volume,
generating a magnetic compensation field for neutralizing the noise field
inside the space volume; wherein the compensation of the magnetic noise
field outside the space volume is carried out along a direction in the
space volume which is variable by determining a noise field component
inside the space volume along the direction and generating a compensation
field of the noise field component along the direction.