Estimating Cosmological Parameters from the Dark Matter Distribution