Atlanta (CNN) Hearing a diagnosis of advanced melanoma, former President Jimmy Carter said he thought he had a few weeks to live, but was "surprisingly at ease" and that he trusted in the treatment prescribed by his doctors at Emory University.

The 39th president had learned in May that he had a "small mass" on his liver and decided to have the elective surgery to remove it on August 3. At that time the Carter Center, his nonprofit organization, released a statement saying "the prognosis is excellent for a full recovery."

But by August 19, a Carter Center statement told a different story. Tests after the liver surgery revealed the cancer was melanoma. An MRI revealed there were four spots of melanoma on his brain. Doctors said the small spots were about 2 millimeters in size.

Melanoma that has spread

Stage IV melanoma is a kind of cancer that starts in the cells that produce the pigment that gives your skin its color, known as melanocytes. Stage IV means it spread via the bloodstream or through the lymphatic system to other areas of the body.

The 90-year-old had a significant book tour planned this year to promote his latest memoir, "A Full Life: Reflections at Ninety," but decided to rearrange his schedule to fit in the treatment. At no point did he consider going without treatment, he told CNN Chief Medical Correspondent Dr. Sanjay Gupta. The former president said he would trust the advice of his doctors.

Focused radiation treatment

Thursday afternoon, Carter was to undergo radiation treatment.

On Wednesday, the hospital fitted him with a mask that will hold his head perfectly still to make sure the radiation goes into the right places in his brain. "Focused radiation as compared to general radiation has shown some success," said Dr. Manmeet Ahluwalia . "That they are really small makes it more likely that these lesions can be controlled."

Ahluwalia is Cleveland Clinics director of the Brain Metastasis Research Program and the associate director for clinical trials, and he has tested this kind of treatment.

Doctors also will give Carter the drug Pembrolizumab -- known by its U.S. brand name Keytruda -- intravenously. The Food and Drug Administration approved the drug in September 2014 to treat melanoma that cannot be removed by surgery, or a cancer that has metastasized. He has four treatments scheduled at three-week intervals.

"Most of the time we would use radiation on this kind of cancer but more recently, in the last couple of years, we were finding out drugs can impact brain metastases," Ahluwalia said. A presentation of a study at the American Society of Clinical Oncology this May showed that the drug has had some successes with patients.

Essentially, the drug works by revving up a patient's own immune system to kill the cancer, according to Ahluwalia.

This aggressive mix of treatments, treatments Carter's oncologist characterized as "the vanguard of cancer treatment," may have a positive impact, but positive impact does have its limitations. Typically with Stage IV melanoma there are "not very good outcomes," Ahluwalia said. Often people will be given a ballpark of six to 12 months to live if they have brain metastases. "However, what we are finding out (is) a select group of patients can derive more durable benefit from Pembrolizumab" and radiation. "But the emphasis is on the word 'select' and even that group typically lives only two to three years longer, but it is still a minority of patients and we also need to factor in the age, which can be important."

'He has a lot to live for'

What is working in Carter's favor, Ahluwalia said, is the active life that Carter leads. Sometimes, he said, that is nearly as big a factor in outcome as age. People who have the sort of positive attitude Carter displayed at the press conference "generally do better."

Carter has watched many of his family members struggle with cancer. He lost his father and all his siblings to pancreatic cancer. His mother died after having breast cancer.

Photos: Jimmy and Rosalynn Carter through the years Photos: Jimmy and Rosalynn Carter through the years Jimmy Carter embraces his wife, Rosalynn, after receiving the final news of his victory in the 1976 presidential election. Reflecting on his accomplishments while addressing his current cancer diagnosis , the former President said, "The best thing I ever did was marrying Rosalynn." Carter married Rosalynn Smith in 1946. "That's a pinnacle of my life," he said. Hide Caption 1 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter speaks on election night at an Atlanta hotel in 1976. Hide Caption 2 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter walks hand-in-hand with Rosalynn and his daughter, Amy, during his inaugural parade in Washington on January 21, 1977. It was the first time in history that a President had not ridden toward the White House in a carriage or automobile to celebrate taking the oath of office. Hide Caption 3 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter holds his wife's hand during the inaugural parade. Hide Caption 4 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter is sworn in by Chief Justice Earl Burger as the 39th President of the United States. Hide Caption 5 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter addresses the media outside his residence in Plains, Georgia, next to his wife and Democratic presidential hopeful Richard Gephardt in March 1988. Hide Caption 6 of 11 Photos: Jimmy and Rosalynn Carter through the years Carter shakes hands with Israeli Labour Party leader Shimon Peres in Jerusalem in March 1990. Hide Caption 7 of 11 Photos: Jimmy and Rosalynn Carter through the years President Bill Clinton, Carter and other former U.S. Presidents stand with their wives during Richard Nixon's funeral in Yorba Linda, California, in April 1994. Hide Caption 8 of 11 Photos: Jimmy and Rosalynn Carter through the years The Carters wave to the audience during the Democratic National Convention in July 2004. Hide Caption 9 of 11 Photos: Jimmy and Rosalynn Carter through the years The Carters attend the grand opening ceremony of the William J. Clinton Presidential Center in Little Rock, Arkansas, in November 2004. Hide Caption 10 of 11 Photos: Jimmy and Rosalynn Carter through the years The Carters attend a MusiCares gala honoring Bob Dylan in February. Hide Caption 11 of 11

What impact this treatment will have on his life going forward is up for debate. Carter said he had hoped to join a Habitat for Humanity build scheduled later this year to replace homes lost in the earthquakes in Nepal, but said he understands that he will generally have to cut back on his busy schedule.

In an interview with CNN's Gupta, Carter's doctor Dr. Walter Curren said that the new therapies made available in the past five years have "far less side effects than standard chemotherapy." He added, "You heard President Carter. He wants to be proactive, he has a lot to live for, and what we offered him is a regimen a man in good health his age can handle."