I remember in a Louis Theroux documentary taking place at some sort of pedo jail/mandatory placement center, there was a test where they had a loop of string or something you put over your willy, you sit in a room with a projector, and they show you images of adults, moving on to children, and then 'p, and if you get a boner, the string can detect it.
Afaik we don't have any tech that would be able to differentiate between generic stress and arousal with acceptable accuracy. When it comes to something as damning as diagnosis pedophiles, i would not be satisfied with anything less than DNA matching levels of accuracy for the test.
Someone knowing that they are being measured in this way, and that the result of the test could label them as a pedo, could start to panic once seeing the child even if they had zero sexual interest in children. Then the machine would pick up the increased heart rate etc and give a false positive. It has the same issues as a polygraph.
Can MRI or other brain-scan techniques detect the signs of pedophilia in the brain?
No. Same way it can't diagnose depression, anxiety disorder etc. Issues like this happen at much smaller chemical scale for MRI to detect. MRI is really for detecting abnormal brain structures etc, not for differentiating between brain signals.
There have been some studies that "Depressed people are more likely to have this and that brain structure abnormalities" but that's not a diagnosis, it's just a correlation. There still are tons of people with obvious depression who don't have these brain structure abnormalities, or people who have them but aren't depressed.
Chances are that by the time we have the technology to map the exact neurons being responsible for pedophilia and other associated creep behavior with some 99.99% accuracy, we would also have complete enough understanding of the human brain to use that knowledge to just be able to engineer any personality trait etc one might have, and thus cure the pedos. Or alternatively use that technology to brainwash people into becoming completely obedient drones by basically rewiring their brain.
Post mental illness utopia probably won't last very long, until it just turns into a complete dystopia. But at least no one will be capable of feeling bad about it.