Two animal welfare organisations have gone to court to improve the protection of pigs.
One of them is SAFE, or Save Animals from Exploitation, which is renowned for its high profile campaigns against the like of abuse of bobby calves and keeping chickens in cages.
The other plaintiff is the New Zealand Animal Law Association.
Both were represented in the High Court in Wellington by Gillian Coumbe QC, who sought a judicial review.
Farrowing crates are cages that keep a sow in a confined spot during the final months of her pregnancy and while she is suckling her piglets.
Coumbe told the court the treatment was inhumane and should not be allowed.
"How is it that an animal which has given birth, effectively in a cage, through bars, feeding her young, through bars, is able to be treated like this?" she asked the court.
"When I mention this to anyone, their initial reaction is 'that's awful'.
"Their second reaction is 'how is this allowed?'."
Coumbe went on to tell the court the decision to approve these crates would not have been made by any reasonable person, based on a reasonable reading of the regulations on animal welfare.
She said the official position on crates had changed several times.
The defendants in this case are the Attorney General, the Minister of Agriculture and a committee of experts reporting to the Ministry for Primary Industries, the National Animal Welfare Advisory Committee.
They are due to defend their position when the court resumes on Tuesday.
Meanwhile, Coumbe told the court the solution to this problem was a reasonable one.
While some activists wanted all pigs to be free range, the plaintiffs merely sought that if pigs were held in an enclosure, it had to be big enough for them to move around.