Dr. Hannibal Hamlin, a retired neurosurgeon at Massachusetts General Hospital in Boston, died 1982. He was 78 years old and lived in Providence, R.@I.

Dr. Hamlin had been associated with Massachusetts General since 1939, and had been chief of its neurosurgical clinic.

He was appointed senior neurosurgeon in 1977 and honorary neurosurgeon in 1979, when he retired.

In research conducted with Prof. Jose Delgado of the Yale Medical School in the 1950's, Dr. Hamlin studied the correlation between the the electrical activity of the brain and physical behavior, specifically in regard to epilepsy. In collaboration with Dr. Oskar Hirsch of Massachusetts General, Dr. Hamlin helped develop a new surgical procedure for pituitary tumors.

Dr. Hamlin, the namesake and descendant of Hannibal Hamlin, Lincoln's Vice President from 1861 to 1865, was born in Brooklyn. He graduated from Yale University in 1927, and from the Yale Medical School in 1936. From 1927 to 1930, Dr. Hamlin led the Whitney South Seas bird-collecting expedition for the American Museum of Natural History. In World War II, he was a surgeon with the Navy in the South Pacific.

He is survived by his wife, Margaret Beck Hamlin; a daughter, Ellen V. Reynolds of Manchester, N.H.; two sons, Prof. Cyrus Hamlin of Toronto, and Dr. Charles Hamlin of Denver; two sisters, Sally Cworowsky of Glen Ridge, N.J., and Eleanor Vendig of Port Washington, L.@I., and five grandchildren.