As the dimensions of magnetic materials decrease to the nanoscale, novel distributions of spin can be created. We are exploring the formation of these novel distributions and ways to control them through gaining an understanding of the local energy landscape of the nanostructures. We are use a combination of Lorentz TEM and in-situ magnetizing experiments, together with micromagnetic simulations, to study the micromagnetic behavior at the sub-micron scale in a range of magnetic nanostructures. Quantitative analysis of the Lorentz TEM data has been carried out using the transport of intensity equation (TIE) approach, which we have extended to allow us to visualize the magnetic structure in three dimensions. By comparing these data with the results of simulations, we are able to gain a fuller understanding of the various energy terms that contribute to the behavior that we observe. In this talk I will focus on skyrmions, which are chiral spin structures, and artificial spin ices consisting of arrays of nanoscale magnetic elements patterned on periodic and quasicrystalline 2D lattices.