text:
Radiation Oncology/Rectum/Neoadjuvant RT

Neoadjuvant Therapy for Rectal Cancer

Preop vs Postop RT
Recommend T3-T4 or N+ pts receive pre-op chemo/RT

 * RTOG 94-01 /INT 0147 - concurrent 5-FU (closed due to poor accrual)
 * NSABP R-03 - concurrent 5-FU (closed due to poor accrual, see summary below)

Chemo-RT
Chemoradiotherapy Regimens in Rectal Cancer
 * Polish II (2008-2014) -- cT3 or cT4 rectal cancer, neoadjuvant short-course sequential chemoradiation vs. long-course concurrent chemoRT
 * Randomized 541 patients to short course radiation (5 Gy x 5 fractions) followed by 3 cycles FOLFOX or long-course concurrent ChRT (50.4 Gy with bolus 5FU and leucovorin)
 * 2016 PMID 26884592 -- "Long-course oxaliplatin-based preoperative chemoradiation versus 5 x 5 Gy and consolidation chemotherapy for cT4 or fixed cT3 rectal cancer." (Bujko K, Annals of Oncology, May;27(5):834-842).
 * Outcome: Local failure: short-course 22%, long-course 21% (NS); any-grade toxicity short-course 75% long-course 83% (SS) but difference mostly in grade 1-2 toxicity.
 * 3-yr OS short-course 73%, long-course 65% (SS)
 * Author's conclusions: differences in local efficacy, but differences in 3-year OS and toxicity favor short-course radiation and sequential chemotherapy.
 * 2019 PMID 31192355 -- "Long-course preoperative chemoradiation versus 5 x 5 Gy and consolidation chemotherapy for clinical T4 and fixed clinical T3 rectal cancer: long-term results of the randomized Polish II study." (Cisel B, Annals of Oncology, Augs1;30(8):1298-1303)
 * Outcome: 8-year OS 49% in both groups. Late toxicity: short-course 11%, long-course 9%. No difference in local failure or development in distant metastases.
 * Author's conclusions: The superiority of short course RT was not demonstrated.

 * MRC CR07 and NCIC C016 (1998-2005) -- preop RT 25/5 vs. selective postop chemo-RT 45/25
 * Randomized. 1350 patients, operable carcinoma of rectum, <15cm from anal verge, TME encouraged but not mandated (done in 92%). Arm 1) RT 25/5 vs. Arm 2) surgery + selective postop chemo-RT if SM+ (RT 45/25 + concurrent 5-FU and leucovorin). RT sacral promontory superiorly, 3–5 cm below the inferior tumor extent, 2–3 cm anterior to the sacral promontory, 1 cm posterior to the anterior sacrum, and 1 cm lateral to the most lateral aspect of the bony true pelvis. Primary outcome LR. In postop arm, SM+ was in 12% as trigger for postop chemo-RT vs 10% in preop group. Adjuvant chemo in 40% of preop arm and 45% of postop arm
 * 2009 PMID 19269519 -- "Preoperative radiotherapy versus selective postoperative chemoradiotherapy in patients with rectal cancer (MRC CR07 and NCIC-CTG C016): a multicentre, randomised trial." (Sebag-Montefiore D, Lancet. 2009 Mar 7;373(9666):811-20.) Median F/U 4 years
 * Outcome: LR preop RT 4% vs. postop RT 11% (SS), DFS 77% vs. 71% (SS), no difference in OS. By SM status: SM+ 14% vs. 21% (NS), SM- 4% vs. 9% (SS). Upper 1/3 tumors lower LRR than lower 1/3, preop RT 1% vs. 5%, postop chemo-RT 6% vs. 10%
 * Conclusion: Short-course RT more effective than selective postop chemo-RT
 * Editorial (PMID 19269501): Preop RT appears to benefit both good-prognosis and bad-prognosis tumors, so need a good way to select, and patient preference likely to play a role. Nevertheless, short preop RT is an excellent option
 * 2009; Plane of surgery PMID 19269520 -- "Effect of the plane of surgery achieved on local recurrence in patients with operable rectal cancer: a prospective study using data from the MRC CR07 and NCIC-CTG CO16 randomised clinical trial." (Quirke P, Lancet. 2009 Mar 7;373(9666):821-8.)
 * Negative CRM and good surgical plane associated with low LR. 3-yr LR 6% vs 17% for negative vs positive resection margin. LR 4% (mesorectal plane), 7% (intramesorectal), and 13% (muscularis propria). Pts with mesorectal excision who had pre-op RT had only a 1% LR.
 * Conclusion: the plane of surgery is an important prognostic indicator for local recurrence. Short-course pre-op RT reduced the rate of LR in all groups

 * German Rectal Cancer Study CAO/ARO/AIO-94 (1995-2002) -- preop chemo-RT vs. postop chemo-RT
 * Randomized. 823 patients, clinical stage T3-4 or N+, inferior margin within 16cm from anal verge. Arm 1) post-op regimen: surgery (TME) -> chemo/RT (55.8 Gy) -> 4 cycles bolus 5-FU, or 2) pre-op regimen: chemo/RT (50.4 Gy) -> surgery (TME) -> 4 cycles bolus 5-FU. In both arms, chemo was 5-FU C.I. 1000 mg/m2/d on days 1-5, weeks 1+5.
 * 2004 PMID 15496622 Full text "Preoperative versus postoperative chemoradiotherapy for rectal cancer." (Sauer R, N Engl J Med. 2004 Oct 21;351(17):1731-40.) Median F/U 3.8 years
 * Outcome: 5-year OS preop 76% vs postop 74% (NS); 5-year DFS 68% vs. 65% (NS); LR 6% vs. 13% (SS); DM 36% vs. 38% (NS). Preop downstaging: pCR 8%, 25% (vs 40%) were Stage III/LN+. TNM Stage I disease found in 18% of post-op group (vs. 25% in pre-op). Increased rate of sphincter-preserving surgery (39% vs 19%) in preoperative-treatment group among patients thought to need it preoperatively; overall rates of sphincter preservation same 69% vs 71%.
 * Toxicity: Fewer acute (27% vs 40%) and late toxicities (14% vs 24%) in preoperative-treatment group.
 * Conclusion: Preop chemo-RT improved local control and improved toxicity, but did not impact overall survival
 * Critique (and clinical reality): only 54% of adjuvant patients vs. 92% of neoadjuvant patients received full RT dose
 * 2012 PMID 22529255 -- "Preoperative Versus Postoperative Chemoradiotherapy for Locally Advanced Rectal Cancer: Results of the German CAO/ARO/AIO-94 Randomized Phase III Trial After a Median Follow-Up of 11 Years." (Sauer R, J Clin Oncol online ahead of print April 23, 2012)
 * Median f/u 134 mo. 10-yr OS preop 59.6% vs postop 59.9% (NS). Local Recurrence: 7.1% vs 10.1% (SS). DM: 29.8% vs 29.6% (NS). DFS: NS.
 * Conclusion: "There is a persisting significant improvement of pre- versus postoperative CRT on local control; however, there was no effect on overall survival. "

 * NSABP R-03 (1993-1999) -- Preop vs postop chemo-RT
 * Randomized. Trial closed prematurely due to poor accrual. 267/900 expected patients. Clinical T3-T4 or N+ rectal cancer. Arm 1) Preop chemo-RT 50.4/28 + 5-FU 500 mg/m2 and leucovorin 500 mg/m2 vs Arm 2) Postop chemo-RT (same as preop). Surgery APR, LAR, or local excision; TME not mandated. Both groups adjuvant 3 cycles of 5-FU/leucovorin
 * 2009 PMID 19770376 Full text — "Preoperative multimodality therapy improves disease-free survival in patients with carcinoma of the rectum: NSABP R-03." (Roh M et al. J Clin Oncol. 2009 Nov 1;27(31):5124-30. Epub 2009 Sep 21.)
 * Outcome: 5-year DFS was improved for pre-op over post-op (64.7% v 53.4%, SS). Nonsignificant trend in 5-year OS (74.5% v 65.6%, p=0.065). No difference in locoregional recurrence, 11% in each group. pCR in 15%. Significant reduction in N+ (67% vs. 52%, SS)
 * Toxicity: Grade 4 diarrhea preop 24% vs. postop 13%; Grade 5 toxicity 5% vs 3%
 * Conclusion: Pre-op chemoradiotherapy, compared with post-op chemoradiotherapy, significantly improved DFS and showed a trend toward improved OS

RT Alone

 * Sweden (Uppsala) (1980-1985)
 * Randomized. Multicenter. 471 patients with rectal and rectosigmoid CA. Treated with 1) preop RT 25.5/5 in one week or 2) postop RT 60/30 (Modified Dukes' stage B2 or C only, equivalent to Dukes B-C, T3-T4 or N+).
 * Technique: Treated prone. Target volume was from the anus up to L4. Three field - PA + 2 angled dorsal beams.
 * 1990 PMID 2405793 (Full-text on Pubmed Central) — "Pre- or postoperative radiotherapy in rectal and rectosigmoid carcinoma. Report from a randomized multicenter trial." Pahlman L et al. Ann Surg. 1990 Feb;211(2):187-95.
 * Minimum F/U 3 years; The early results are as follows
 * LR: preop RT 12% vs. postop RT 21% (SS, p<0.02). No difference in OS
 * Toxicity: Pre-op vs Post-op RT [ Mortality-3% vs 5% (NS); Post-op perineal sepsis-33% vs 18% (SS,p<0.01)
 * 1993 PMID 8500374 — "Preoperative or postoperative irradiation in adenocarcinoma of the rectum: final treatment results of a randomized trial and an evaluation of late secondary effects." (Frykholm GJ, Dis Colon Rectum. 1993 Jun;36(6):564-72.)
 * Minimum F/U 5 years
 * LR: preop RT 13% vs. postop RT 22% (SS). No difference in OS
 * Toxicity: SBO rate - preop RT 5% vs. postop RT 11% vs. surgery alone 6%
 * Conclusion: Preop RT better, late morbidity comparable after 5-10 year follow-up

Preop RT vs. surgery alone

 * Goal is sphincter preservation
 * On meta-analysis, 5-year decrease in local recurrence from 22% with surgery alone to 12% with pre-op RT
 * No impact on overall survival. Rectal cancer survival was significantly better with pre-op RT (50% vs. 45%), but early mortality was significantly higher as well (8% vs. 4%), for no difference in OS

Total Mesorectal Excision

 * Dutch (1996-1999)
 * Randomized. 1805 patients treated with 1) Preop RT 25/5 or 2) TME alone. If surgery-only patients had SM+ (<=1mm), mandatory post-op RT
 * 2-years; 2001 PMID 11547717 -- "Preoperative radiotherapy combined with total mesorectal excision for resectable rectal cancer." (Kapiteijn E, N Engl J Med. 2001 Aug 30;345(9):638-46.)
 * 2-year OS: RT 82% vs. TME alone 82%
 * 2-year LR: RT 2.4% vs. TME alone 8.2% (SS)
 * Conclusion: Short-term preop RT reduces risk of LR with TME
 * 2003 PMID 12654443 -- "Radiotherapy does not compensate for positive resection margins in rectal cancer patients: report of a multicenter randomized trial." (Marinjen CA, Int J Radiat Oncol Biol Phys. 2003 Apr 1;55(5):1311-20.)
 * LR as a function of surgical margins:
 * Wide SM: preop RT 1% vs. 6% (SS)
 * Narrow SM: preop RT 0% vs. 15% (SS)
 * Positive SM: preop RT 9% vs. 16% (NS)
 * 120 patients in surgery-only group with SM+; 47% received post-op RT; LR: Post-op RT 17% vs. surgery only 16% (NS)
 * Conclusion: Preop RT beneficial with wide or narrow SM, but not in positive SM.
 * 5-years; 2007 PMID 17968156 -- "The TME Trial After a Median Follow-up of 6 Years: Increased Local Control But No Survival Benefit in Irradiated Patients With Resectable Rectal Carcinoma." (Peeters KC, Ann Surg. 2007 Nov;246(5):693-701.). Median F/U 6.1 years
 * Outcome: 5-year LR TME 11% vs. RT + TME 6% (SS); OS 63% vs. 64% (NS)
 * Subgroup benefit: N+, tumors 5-10 cm from anal verge, negative radial margins
 * Conclusion: Preop short-term RT improves local control; no effect on survival
 * Local Recurrence; 2010 PMID 20096534 -- "Patterns of local recurrence in rectal cancer; a study of the Dutch TME trial." (Kusters M, Eur J Surg Oncol. 2010 Jan 20. [Epub ahead of print])
 * Outcome: 5-year LR rate RT+ 5% vs RT- 11%. Most common location presacral failure (43% and 33%). RT significantly reduced anastomotic LR (from 2.7% to 0.7%)
 * Conclusion: RT reduces LR in all subsites, and is especially effective in preventing anastomotic LR after LAR
 * 12-years; 2011 PMID 21596621 -- "Preoperative radiotherapy combined with total mesorectal excision for resectable rectal cancer: 12-year follow-up of the multicentre, randomised controlled TME trial." (van Gijn W, Lancet Oncol. 2011 Jun;12(6):575-82.)
 * 10-yr incidence of LR 5% RT+ vs 11% RT-. No difference in OS.
 * Conclusion: LR reduced by more than 50% with RT compared to TME alone.

Non-TME Surgical Technique

 * Swedish Rectal Cancer Trial (1987-1990)
 * Randomized. 1168 patients, 908 curative intent (included 316 patients from Stockholm II). Treated with 1) preop RT 25/5, surgery within 1 week or 2) surgery alone. RT given as AP/PA, 3-field, or 4-field; superior border at L4
 * 1993 PMID 8242317 — "Initial report from a Swedish multicentre study examining the role of preoperative irradiation in the treatment of patients with resectable rectal carcinoma. Swedish Rectal Cancer Trial." [No authors]. Br J Surg. 1993 Oct;80(10):1333-6.
 * Postop mortality comparable (4% vs. 3%); but much higher if 2F rather than 3F or 4F technique (15% vs. 3%)
 * No difference in anastomotic dehiscence or other complications; more wound infections with RT
 * 1995 PMID 8781922 — "Local recurrence rate in a randomised multicentre trial of preoperative radiotherapy compared with operation alone in resectable rectal carcinoma. Swedish Rectal Cancer Trial." [No authors]. Eur J Surg. 1996 May;162(5):397-402.
 * Local recurrence at 2 years: RT 9% vs. surgery alone 24% (SS); significant for all Dukes stages
 * 1997 PMID 9091798 — "Improved survival with preoperative radiotherapy in resectable rectal cancer. Swedish Rectal Cancer Trial." Pahlman L et al. [No authors listed] N Engl J Med. 1997 Apr 3;336(14):980-7.
 * Local recurrence at 5 years: RT 11% vs surgery alone 27% (SS)
 * Overall survival: RT 58% vs 48% (SS)
 * Cost-effectiveness; 2002 PMID 12377315 -- "Cost-effectiveness of preoperative radiotherapy in rectal cancer: results from the Swedish Rectal Cancer Trial." (Dahlberg M, Int J Radiat Oncol Biol Phys. 2002 Nov 1;54(3):654-60.)
 * 8 year F/U. 98/1168 randomly selected patients from main trial from single region.
 * Total costs: RT USD 35,300 vs. surgery alone USD 30,000
 * Survival benefit 21 months - cost of year saved USD 3,654. Sensitivity analysis worst case USD 15,228
 * 13-years; 2005 PMID 16110023 — "Swedish Rectal Cancer Trial: long lasting benefits from radiotherapy on survival and local recurrence rate." Folkesson J et al. J Clin Oncol. 2005 Aug 20;23(24):5644-50. Median F/U 13 years
 * Overall survival: RT 38% vs. surgery alone 30% (SS); cancer-specific 72% vs. 62% (SS)
 * Local recurrence: RT 9% vs. surgery alone 26% (SS)
 * Late toxicity; 2005 PMID 16314629 — "Adverse effects of preoperative radiation therapy for rectal cancer: long-term follow-up of the Swedish Rectal Cancer Trial." Birgisson H et al. J Clin Oncol. 2005 Dec 1;23(34):8697-705.
 * Side effects: RT group more likely to be admitted <6 months after treatment (mostly GI related); no difference >6 months out
 * Bowel obstruction: more common long term in RT patients
 * Late GI toxicity; 2008 PMID 17849380 -- "Late gastrointestinal disorders after rectal cancer surgery with and without preoperative radiation therapy." (Birgisson H, Br J Surg. 2008 Feb;95(2):206-13.)
 * Outcome: RT increased risk of SBO (RR 2.5), surgically managed SBO (RR 7.4). Difference seen after 7-8 years for conservatively managed SBO, after 1-2 years for surgically managed SBO. No impact of RT technique
 * Conclusion: Small bowel obstruction more common in preop RT
 * Conclusion : 8% survival benefit, 10% cancer specific benefit, 17% local recurrence benefit long term
 * Criticism : high recurrence rate in surgery-alone arm (26%)

 * Stockholm 1 (1980-1987)
 * Randomized. 849 patients, 679 curative intent. Treated with 1) preop RT 25/5 vs. 2) surgery alone. Median F/U 4.4 years
 * 1995 PMID 7712435 -- "The Stockholm I trial of preoperative short term radiotherapy in operable rectal carcinoma. A prospective randomized trial. Stockholm Colorectal Cancer Study Group." (Cedermark B, Cancer. 1995 May 1;75(9):2269-75.). Median F/U 8.9 years
 * Curative intent: LR (SS) better with RT. Time-to-failure (SS) better with RT. No difference in DM or OS
 * Toxicity: postop mortality 8% with RT vs. 2% surgery only (SS)
 * 1990 PMID 2191763 -- "Preoperative short-term radiation therapy in operable rectal carcinoma. A prospective randomized trial. Stockholm Rectal Cancer Study Group." (No Authors, Cancer. 1990 Jul 1;66(1):49-55.)
 * RT fields to pelvis and para-aortic LN to L2. AP/PA portals permitted.
 * Curative intent: LR (SS) better with RT. Time-to-failure (SS) better with RT. No difference in DM or OS
 * Toxicity: postop mortality 8% with RT vs. 2% surgery only (SS)
 * Conclusion: preop RT better, but at high periop mortality cost. RT fields need to be adjusted, see Stockholm 2

 * Stockholm 2
 * Randomized. 557 patients from 12 centers. Treated with 1) preop RT 25/5, or 2) surgery alone. RT fields to pelvis only, mandated 3F or 4F plans (no AP/PA only). Median F/U 4.2 years
 * 1996 PMID 8876883 -- "Randomized study on preoperative radiotherapy in rectal carcinoma. Stockholm Colorectal Cancer Study Group." (No Authors, Ann Surg Oncol. 1996 Sep;3(5):423-30.)
 * Outcome: LR: preop RT 10% vs. surgery only 21% (SS). Distant mets 19% vs. 26% (SS); OS improved with preop RT
 * Conclusion: Preop RT reduces LR and DM, and improves OS

 * Stockholm 3
 * Randomized. 303 patients were randomized to either short-course RT (5 x 5 Gy) and surgery within 1 week (group 1), short-course RT and surgery after 4-8 weeks (group 2) or long-course RT (25 x 2 Gy) and surgery after 4-8 weeks (group 3). No Chemotx allowed in this trial.
 * 2010 PMID 20155787 -- "Interim analysis of the Stockholm III trial of preoperative radiotherapy regimens for rectal cancer." (Pettersson D, Br J Surg. 2010 Apr;97(4):580-7)
 * Outcome: Patients receiving short-course RT with surgery 11-17 days after the start of RT had the highest complication rate (~65% of patients).
 * Conclusion: 4-8 week delay after short-course RT decreases complication rate.

 * MRC (1981-1989) PMID 8961989 -- "Randomised trial of surgery alone versus radiotherapy followed by surgery for potentially operable locally advanced rectal cancer. Medical Research Council Rectal Cancer Working Party." (No Authors, Lancet. 1996 Dec 14;348(9042):1605-10.)
 * Randomized. 279 patients from 20 centers. Treated with 1) surgery alone, or 2) preop RT 40/20. Minimum F/U 5 years
 * Median OS: 24 months vs. 31 months (NS). But benefit on DFS
 * LR: surgery 46% vs. preop RT 36% (SS). DM surgery 48% vs. preop RT 35%
 * Conclusion: Preop RT reduces LR, but survival equivocal

 * UK Multicentre PMID 7530469 -- "Long-term results of a randomised trial of short-course low-dose adjuvant pre-operative radiotherapy for rectal cancer: reduction in local treatment failure." (Goldberg PA, Eur J Cancer. 1994;30A(11):1602-6.)
 * Randomized. 468 patients with rectal CA <=12 cm from anal verge. RT 15/3 within 2 days of surgery vs. surgery alone. Minimum F/U 5 years
 * Perioperative mortality: RT 9% vs. surgery alone 4% (SS)
 * LR: RT 17% vs. surgery alone 24% (SS)
 * No difference in OS

 * Northwest Rectal Cancer Group (UK) (1982-1986) PMID 7995145 -- "Adjuvant preoperative radiotherapy for locally advanced rectal carcinoma. Results of a prospective, randomized trial." (Marsh PJ, Dis Colon Rectum. 1994 Dec;37(12):1205-14.)
 * Randomized. 284 patients. Preop RT 20/4 to 10x10x10cm volume in posterior pelvic vs surgery alone. Minimum F/U 8 years
 * No difference in overall or cancer-specific survival, but survival benefit for subset considered to receive curative operation
 * LR: RT 13% vs. surgery alone 36% (SS). 10 recurrences infield, 6 recurrences out of field. DM same
 * Conclusion: Recommend to all patients who will undergo curative surgery

 * Western Norway (1976-1985) PMID 2245382 -- "Low-dose preoperative radiation postpones recurrences in operable rectal cancer. Results of a randomized multicenter trial in western Norway." (Dahl O, Cancer. 1990 Dec 1;66(11):2286-94.)
 * Randomized. 309 patients. Randomized to preop RT 31.5/18 with radical surgery 2-3 weeks later, or surgery alone
 * No tumor in 5% patients. No increased morbidity or mortality at surgery
 * 5-year OS: surgery alone 57% vs. RT 57%
 * Recurrence: surgery alone 13 months vs. RT 27 months (SS); LR 21% vs. 14%
 * Conclusion: should use higher RT dose

 * Sao Paulo (1978-1980) PMID 2752859 -- "A comparison of nonoperative vs. preoperative radiotherapy in rectal carcinoma. A 10-year randomized trial." (Reis Neto JA, Dis Colon Rectum. 1989 Aug;32(8):702-10.)
 * Randomized. 68 patients (26% in group 1 were Dukes C, 47% in group 2 were Dukes C). Randomized to 1) preoperative RT 40/20 + surgery within 1 week, or 2) surgery alone. Minimum F/U 8 years
 * 5-year OS: RT 80% vs. 34%
 * Local recurrence: RT 3% vs. 23%

 * EORTC (1976-1981) PMID 3056288 -- "Preoperative radiotherapy as adjuvant treatment in rectal cancer. Final results of a randomized study of the European Organization for Research and Treatment of Cancer (EORTC)." (Gerard A, Ann Surg. 1988 Nov;208(5):606-14.)
 * Randomized. 466 patients. Treated with 1) surgery alone, or 2) preop RT 34.5/15 in 2.3 Gy/fx
 * 5-year OS: no difference (59% vs. 69%) (p=0.08)
 * 5-year LR: surgery 30% vs. 15% (SS)

 * Meta-analysis, 2001 PMID 11684209 -- "Adjuvant radiotherapy for rectal cancer: a systematic overview of 8,507 patients from 22 randomised trials." (Colorectal Cancer Collaborative Group, Lancet. 2001 Oct 20;358(9290):1291-304.)
 * 22 randomized trials comparing pre- and post-op RT with surgery alone. Centrally analysed individual patient data from 14 preop (6,350 patients) and 8 postop (2,157 patients)
 * 5-year OS: marginally better with RT (62% vs. 63%, p=0.06)
 * Curative resection: not improved by RT (86% vs. 85%)
 * Annual risk of recurrence: preop RT 46% lower, postop RT 37% lower
 * Preop RT: fewer deaths from rectal CA (45% vs. 50%, SS), but more early deaths (8% vs. 4%, SS)
 * Conclusion: Preop RT reduces risk of LR and death from rectal cancer, but due to high early mortality has no impact on overall survival. Post-op RT also reduces LR.

Preop RT vs Preop Chemo-RT

 * Cochrane Meta-analysis--
 * 2013 PMID 23450565 -- "Preoperative chemoradiation versus radiation alone for stage II and III resectable rectal cancer." (Laura De Caluwé et al.Cochrane Database Syst Rev. 2013 Feb 28;2)
 * Five trials were identified and included in the meta-analysis. From one of the included trials only preliminary data are reported.
 * Outcome:
 * Response rate: CRT significantly increased the rate of complete pathological response (OR 2.12-5.84, P < 0.00001)
 * Sphincter Preservation: did not translate into a higher sphincter preservation rate (OR 0.92-1.30, P = 0.32)
 * Post-op Morbidity: marginally affected postoperative overall morbidity (OR 0.67-1.00, P = 0.05)
 * Anastomotic leak: No differences were observed in anastomotic leak rate
 * Post-op Mortality: No differences were observed in postoperative mortality
 * Local recurrence: at five years was significantly lower in the CRT group compared to RT alone (OR 0.39-0.72, P < 0.001).
 * Survival: No statistically significant differences in DFS (OR 0.92-1.34, P = 0.27) or OS (OR 0.79-1.14,P = 0.58) at five years.
 * Toxicity: increased grade III and IV acute toxicity (OR 1.68-10, P = 0.002)
 * Conclusion: CRT results in SS improved pCR and LC but this does not translate into either improved sphincter preservation or OS/DFS benefit.

 * TROG 01.04 (Trans-Tasman Radiation Oncology Group) -- RT 25/5 Short Course vs Chemo-RT 50.4/28 with C.I. 5-FU
 * Randomized. 326 pts. Staged with ultrasound or MRI as T3N0-2. Short course (SC): RT 25/5 followed by early surgery and 6 courses of adjuvant chemo. Long course (LC): 50.4/28 with 5-FU, followed by surgery in 4-6 weeks, then 4 courses of adjuvant chemotherapy.
 * 2012 PMID 23008301 -- "Randomized Trial of Short-Course Radiotherapy Versus Long-Course Chemoradiation Comparing Rates of Local Recurrence in Patients With T3 Rectal Cancer: Trans-Tasman Radiation Oncology Group Trial 01.04" (Ngan SY, J Clin Oncol. 2012 -- online before print, 9/24/12)
 * No significant differences in LR, DR, or OS. 3-yr LR: 7.5% for SC vs 4.4% for LC (NS). 5-yr distant recurrence: 27% vs 30% (NS). 5-yr OS: 74% vs 70% (NS). Late toxicity rates not different.
 * Distal tumors (< 5 cm): LR in 6 of 48 pts (SC) vs 1 of 31 (LC) (NS).
 * Conclusion: "Three-year LR rates between SC and LC were not statistically significantly different." "LC may be more effective in reducing LR for distal tumors. No differences in rates of distant recurrence, relapse-free survival, overall survival, or late toxicity were detected."

 * French FFCD 9203 (1993-2003)
 * 733 pts. Resectable T3-T4, Nx. Randomized to: 1) 45 Gy RT alone vs 2) RT with concurrent bolus 5-FU (350 mg/m2) + leucovorin on days 1-5, weeks 1,5. Both groups followed by surgery and 4 cycles of adjuvant 5-FU/Leucovorin.
 * 2006 PMID 17008704 -- "Preoperative radiotherapy with or without concurrent fluorouracil and leucovorin in T3-4 rectal cancers: results of FFCD 9203." (Gerard JP, J Clin Oncol. 2006 Oct 1;24(28):4620-5.)
 * 5-year OS (primary endpoint): no difference. Sphincter preservation: no difference
 * 5-year LR: CRT 8% vs. 16% RT alone (SS)
 * Grade 3+ toxicity: CRT 15% vs. 3% RT alone (SS)
 * Conclusion: chemoradiation recommended for improved local control
 * 2005 ASTRO Plenary #4 - No PMID Webcast — "Preoperative Chemoradiotherapy (CT-RT) Improves Local Control in T3-4 Rectal Cancers: Results of the FFCD 9203 Randomized Trial." Gerard J et al. IJROBP Volume 63, Supplement 1, 1 October 2005, Pages S2-S3.
 * Median f/u 69 mo. Equivalent rate of sphincter-sparing surgery, 51%. Chemo/RT led to improved pCR 11.7% vs 3.7%, 5-yr LF 8% vs 16.5%. No diff in OS.
 * Conclusion: less tumor recurrence after chemo/RT compared to RT alone

 * EORTC 22921
 * Randomized. 2x2 design. 1011 patients with T3 or T4 resectable rectal CA. Treated with 1) Preop RT, 2) Preop CRT, 3) Preop RT + postop CT, or 4) Preop CRT + postop CT. RT given 45/25 to posterior pelvis. 5-FU given 350 mg/m2/day
 * 2007 PMID 17906203 -- "Patients with curative resection of cT3-4 rectal cancer after preoperative radiotherapy or radiochemotherapy: does anybody benefit from adjuvant fluorouracil-based chemotherapy? A trial of the European Organisation for Research and Treatment of Cancer Radiation Oncology Group." (Collette L, J Clin Oncol. 2007 Oct 1;25(28):4379-86.)
 * Data from 785 patients with adjuvant chemo
 * Outcome: No benefit in entire group. However, ypT0-2 benefit (SS), while ypT3-4 no benefit
 * Conclusion: Only good-prognosis patients (T0-2 on surgery) benefit from adjuvant chemo
 * 2006 PMID 16971718 -- "Chemotherapy with preoperative radiotherapy in rectal cancer." (Bosset JF, N Engl J Med. 2006 Sep 14;355(11):1114-23.)
 * 5-year OS: overall 65% (no difference among the 4 groups)
 * 5-year LR: preop RT 17% vs. CRT 9% (preop CRT 9% vs. preop RT + postop CT 10% vs. preop CRT + postop CT 8%)
 * Adherence: 82% for preop CT vs. 43% for postop CT
 * 2005 PMID 16009958, 2005 — "Enhanced tumorocidal effect of chemotherapy with preoperative radiotherapy for rectal cancer: preliminary results--EORTC 22921." Bosset JF et al. J Clin Oncol. 2005 Aug 20;23(24):5620-7.
 * Tumors after preop CRT vs RT alone: smaller, lower pT, lower pN, fewer examined nodes, less LVN, increase in mucinous tumors
 * Conclusion: Significant downstaging with CRT over RT alone
 * Dose Escalation; 1993 PMID 8398268 -- "Determination of the optimal dose of 5-fluorouracil when combined with low dose D,L-leucovorin and irradiation in rectal cancer: results of three consecutive phase II studies. EORTC Radiotherapy Group." (Bosset JF, Eur J Cancer. 1993;29A(10):1406-10.)
 * Three Phase II 5-FU dose escalation trials. Locally extended rectal CA. Preop RT 45/25 + concurrent 5-FU.
 * Dose: 425 mg/m2/day + 370 mg/m2/day => 370 mg/m2/day + 370 mg/m2/day => 350 mg/m2/day + 350 mg/m2/day
 * Conclusion: 350 mg/m2/day best tolerated; used in EORTC 22921
 * Overall conclusion: chemo adds significant benefit to RT alone, regardless if it's before or after surgery

Preop Chemo-RT vs Preop Chemo Only

 * PROSPECT / Alliance N1048 (2012 - 2018) -- 1) FOLFOX vs 2) CRT
 * Randomized. T2N+ or T3, candidate for sphincter-sparing surgery. 1128 patients. Arm 1) FOLFOX x6 cycles Q2W (RT permitted if primary tumor decrease <20% or FOLFOX discontinued for side effects), vs Arm 2) RT 50.4 Gy in 28 fractions with 5FU. Primary endpoint DFS
 * Outcome; 2023 PMID 37272534 -- "Preoperative Treatment of Locally Advanced Rectal Cancer" (Schrag D, N Engl J Med. 2023 Jul 27;389(4):322-334. doi: 10.1056/NEJMoa2303269. Epub 2023 Jun 4.
 * Outcome: 5-year DFS FOLFOX 81% vs CRT 79% (NS), no difference in OS or LR
 * Conclusion: Preop FOLFOX non-inferior to CRT
 * Patient Reported Outcomes; 2023 PMID 37270691 -- "Patient-Reported Outcomes During and After Treatment for Locally Advanced Rectal Cancer in the PROSPECT Trial (Alliance N1048)" (Basch E, J Clin Oncol. 2023 Jul 20;41(21):3724-3734. doi: 10.1200/JCO.23.00903. Epub 2023 Jun 4.)
 * FOLFOX better: diarrhea, overall bowel function
 * CRT better: anxiety, appetite, constipation, depression, dysphagia, dyspnea, edema, fatigue, mucositis, nausea/vomiting, neuropathy
 * No difference: bladder function
 * Conclusion: Distinctive side effect profiles for shared decision making

Preop Chemo-RT/adjuvant chemo vs. Total Neoadjuvant Therapy

 * RAPIDO (2011-2016) -- 1) Total Neoadjuvant Therapy 25 Gy in 5 fx, then CAPOX or FOLFOX4, then TME; or 2) Conventional ChRT 50.4 Gy in 28 fx with concurrent 5FU or capecitabine, TME, then CAPOX or FOLFOX4
 * Randomized 920 - "high-risk on pelvic MRI" including cT4a or cT4b, extramural vascular invasion, cN2, involved mesorectal fascia or enlarged lateral lymph nodes, multicenter Europe and USA
 * 2021 PMID 33301740 -- "Short-course radiotherapy followed by chemotherapy before total mesorectal excision (TME) versus preoperative chemoradiotherapy, TME and optional adjuvant chemotherapy in locally advanced rectal cancer (RAPIDO)" (Bahadoer RR, Lancet Oncol 2021)
 * Outcome: 3-yr recurrence rate TNT 23.7%, conventional 30.4%; Grade 3 diarrhea TNT 18%, conventional 9%
 * Conclusions: Decrease in disease-related treatment failure "probably indicative of the increased efficacy of preoperative chemotherapy."
 * 2023 PMID 36661037 -- "Locoregional failure during and after short-course radiotherapy followed by chemotherapy and surgery compared with long-course chemoradiotherapy and surgery: A 5-year follow up of the RAPIDO trial." (Dijkstra EA, Ann Surg 2023)
 * Outcome: At 5-yr median f/u, LRR Short-course RT 10%, conventional 6% (SS)
 * Conclusions: Short-course radiation (in TNT arm) associated with increase in locorgeional recurrence. Refinement of TNT needed.

Preop Chemo-RT: Chemotherapy Regimen
Randomized studies:

+/- Oxaliplatin:
 * STELLAR (China) (2015-2018) -- RT 25/5 + chemo vs RT 50/25 + chemo
 * Randomized. 599 patients, distal/middle rectal cancer, Stage III-IV or N+. Arm 1) RT 25/5 over 1 week followed by chemo x4 cycles (TNT) vs RT 50/25 over 5 weeks with concurrent capecitabine (CRT). Total mesorectal excision 6-8 weeks later. Followed by Arm 1) CAPOX x 2 cycles or Arm 2) CAPOX x6 cycles. Primary endpoint 3-year DFS
 * 2022 PMID 35263150 -- "Multicenter, Randomized, Phase III Trial of Short-Term Radiotherapy Plus Chemotherapy Versus Long-Term Chemoradiotherapy in Locally Advanced Rectal Cancer (STELLAR)" (Jin J, J Clin Oncol. 2022 Mar 9;JCO2101667.doi: 10.1200/JCO.21.01667. Online ahead of print.) Median F/U 2.9 years
 * Outcome: 3-year DFS TNT 64% vs CRT 62% (NS). 3-year OS 86% vs 75% (p=0.03)
 * Toxicity: Acute G3+ 26% vs 12% (p<0.001)
 * Conclusion: Short term RT with chemo efficacious, acceptable toxicity, can be used as alternative to CRT
 * STAR-01 -- 5-FU +/- Oxali
 * Randomized. 747 pt, T3-T4 or N+. RT 50.4 Gy. Randomized to: Arm A) C.I. 5-FU alone (225 mg/m2/d), or B) 5-FU plus oxaliplatin (60 mg/m2 weekly).
 * 2011 PMID 21606427 -- "Primary Tumor Response to Preoperative Chemoradiation With or Without Oxaliplatin in Locally Advanced Rectal Cancer: Pathologic Results of the STAR-01 Randomized Phase III Trial." (Aschele C, J Clin Oncol. 2011 May 23. [Epub ahead of print])
 * No difference in pCR rate (16% in both arms), pN+ (26% vs 29%), pT3 (46% vs 44%), or positive circumferential resection margins (7% v 4%).
 * Grade 3-4 toxicity more frequent with oxali (8% v 24%). Higher rate of completing RT (>45 Gy) in control arm: 97% vs 91%.
 * Conclusion: Adding oxaliplatin to 5-FU - RT increases toxicity without affecting tumor response.

 * ACCORD 12/0405-Prodige 2 (2005-2008) -- Cap 45 vs Capox 50
 * Randomized. 598 patients, resectable T3-T4 rectal adenoca, T2 tumors in anterior/lower rectum also included. Arm 1) RT 45/25 with concurrent capecitabine 800 mg/m2 BID (Cap 45) vs Arm 2) RT 50/25 with concurrent capecitabine 800 mg/m2 BID and oxaliplatin 50 mg/m2 QW (Capox 50). RT excluded external/common illiac, in Capox 50 group boost after 44 Gy. Primary endpoing ypCR to get quick answer, as follow up to FFCD 9203
 * 2010 PMID 20194850 -- "Comparison of two neoadjuvant chemoradiotherapy regimens for locally advanced rectal cancer: results of the phase III trial ACCORD 12/0405-Prodige 2." (Gerard JP, J Clin Oncol. 2010 Apr 1;28(10):1638-44. Epub 2010 Mar 1.)
 * Outcome: ypCR Cap45 14% vs Capox 50 19% (NS). SM+ (0-2mm) 19% vs 10% (SS)
 * Toxicity: Preop G3+ Cap 45 1% vs Capox 50 25% (SS). No difference in surgery (75%) or postop deaths (0.3%).
 * Conclusion: Benefit of oxaliplatin not demonstrated. Suggest Cap 50 as the next regimen to test
 * 2012 PMID 23109696 -- "Clinical Outcome of the ACCORD 12/0405 PRODIGE 2 Randomized Trial in Rectal Cancer." (Gerard JP, J Clin Oncol -- online before print, Oct 29 2012.)
 * At 3 yrs, no sig difference in LR (Cap45 6.1% vs Capox50 4.4%), OS (87.6% vs 88.3%), or DFS (67.9% vs 72.7%).
 * On multivariate analysis, the main prognostic factor was the pCR rate
 * Conclusion: "At 3 years, no significant difference in clinical outcome was achieved with the intensified CAPOX regimen. When compared with other recent randomized trials, these results indicate that concurrent administration of oxaliplatin and RT is not recommended. "

+/- Cetuximab
 * EXPERT-C Clinicaltrials - Randomized Phase II -- Preop chemo/RT and adjuvant chemo +/- Cetuximab
 * 165 pts. Operable tumors, MRI defined high risk (1 or more of following: tumors within 1 mm of mesorectal fascia, T3 tumors at or below levators, extending >= 5 mm into perirectal fat, T4 tumors, extramural venous invasion).
 * Randomized to: 1) Neoadjuvant oxali + capecitabine (CAPOX) x 4 cycles; followed by neoadjuvant chemo/RT with concurrent capecitabine; surgery / TME; adjuvant chemotherapy CAPOX x 4 cycles; or 2) same regimen plus cetuximab (given weekly during neoadj chemo and chemo/RT x 17 weeks, adjuvant x 12 weeks)
 * 2012 PMID 22473163 -- "Multicenter Randomized Phase II Clinical Trial Comparing Neoadjuvant Oxaliplatin, Capecitabine, and Preoperative Radiotherapy With or Without Cetuximab Followed by Total Mesorectal Excision in Patients With High-Risk Rectal Cancer (EXPERT-C)" (Dewdney A, J Clin Oncol. 2012 Apr 2. [Epub ahead of print])
 * 60% of tumors were KRAS or BRAF wild-type. In tumors that were wild-type, addition of cetuximab did not improve pCR: 9% (CAPOX) vs 11% (CAPOX+C); PFS not improved. Cetuximab improved RR (51 vs 71% after chemo, 75 vs 93% after RT); improved OS (HR 0.27). Increased skin toxicity and diarrhea.
 * Conclusion: "Cetuximab led to a significant increase in RR and OS in patients with KRAS/BRAF wild-type rectal cancer, but the primary end point of improved CR was not met."

 Single-arm studies: Capecitabine + Irinotecan:
 * North Wales -- phase II
 * 110 pts. MRI staged, tumor involving or within 2mm of mesorectal fascia. RT 45 Gy / 25 f. Concurrent oral capecitabine daily, IV irinotecan weekly x 4 weeks.
 * 2011 PMID 21263095 -- "Preoperative Chemoradiotherapy Using Concurrent Capecitabine and Irinotecan in Magnetic Resonance Imaging-Defined Locally Advanced Rectal Cancer: Impact on Long-Term Clinical Outcomes." (Gollins S, J Clin Oncol. 2011 Mar 10;29(6):1042-1049.)
 * pCR 22%. 67% with T-stage downstaging, 80% with N-stage downstaging. Negative circumferential resection margin in 92%. 3-yr LRFS 96.9%, MFS 71.1%, DFS 63.5%, OS 88.2%.

Clinical stage T3 N0

 * Multicenter; 2008 PMID 18202411 -- "cT3N0 rectal cancer: potential overtreatment with preoperative chemoradiotherapy is warranted." (Guillem JG, J Clin Oncol. 2008 Jan 20;26(3):368-73.)
 * Retrospective. 188 pts. Multicenter, international, 6 institutions. Purpose: Analysis of preoperatively staged cT3N0 (by EUS or MRI) pts to look at accuracy of staging lymph nodes. All pts treated with neoadjuvant chemo/RT.
 * Rate of pathologically positive lymph nodes after chemo/RT in cT3N0 pts was 22%. The true rate of positive lymph nodes may be higher, due to downstaging by chemo/RT.
 * Conclusion: Recommend that preoperative chemo/RT should remain the standard of care for T3N0 patients.

RT Dose Escalation

 * Princess Margaret, 2006 (1998-2002) - PMID 16242252 — "Preoperative radiation with concurrent chemotherapy for resectable rectal cancer: Effect of dose escalation on pathologic complete response, local recurrence-free survival, disease-free survival, and overall survival." Wiltshire KL et al. Int J Radiat Oncol Biol Phys. 2006 Mar 1;64(3):709-16.
 * Review of 3 Phase II studies of preoperative chemo/RT. T2 N1-2 or T3-4 N0-2. The 3 cohorts were treated to 40 Gy/20 fx, 46 Gy/23 fx, or 50 Gy/25 fx. Continuous infusion 5-FU 7 days/wk.
 * pCR in 15%, 23%, and 33%. 2-yr LRFS 72%, 90%, 89%. DFS 62%, 84%, 78%. OS 72%, 94%, 92%.
 * Conclusion: increase in LRFS, DFS, and OS with doses 46 Gy and higher, but no difference between 46 and 50 Gy.

 * RTOG 00-12, 2006 (2001-2003)
 * PMID 16446336, 2006 — "Randomized Phase II Study of Neoadjuvant Combined-Modality Chemoradiation for Distal Rectal Cancer: Radiation Therapy Oncology Group Trial 0012." Mohiuddin M et al. J Clin Oncol, Vol 24, No 4 (February 1), 2006: pp. 650-655.
 * Objectives: determine pCR rate of preoperative chemo/RT
 * Randomized Phase II. 103 pts. T3 or T4 distal rectum (<9cm from dentate line). Randomized to: 1) CVI 5-FU + HF-RT 55.2 - 60 Gy (1.2 Gy BID), or 2) CVI 5-FU + irinotecan + CF-RT 50.4-54 Gy (1.8 Gy/d).
 * Response rate similar between the two arms. pCR 28% (higher than in other studies).

 * Lyon R96-02 (1996-2001) -- RT 39/13 or RT 39/13 + boost 85/3
 * Randomized. 88 patients. Low rectum tumors, T2-T3Nx, involving <2/3 circumference. Treated with 1) preop RT 39/13 or 2) same RT + endocavitary boost of 85/3
 * 2004 PMID 15197202 -- "Improved sphincter preservation in low rectal cancer with high-dose preoperative radiotherapy: the lyon R96-02 randomized trial." (Gerard JP, J Clin Oncol. 2004 Jun 15;22(12):2404-9.)
 * Response: CR 2% vs. 24% boost; sterilization 34% vs. 57%. Median F/U 2.8 years
 * 2-year outcome: no difference in morbidity, LR, or OS. Significant benefit for sphincter preservation (76% vs 44%, SS) in boost group
 * Conclusion: dose escalation feasible, improved tumor response in early follow-up

Interval between neoadjuvant RT and surgery

 * Lyon R90-01 (1991-1995) -- 2 week interval vs 6-8 week interval between neoadjuvant RT (39/13) and surgery
 * Randomized. 29 French centers. 201 patients with T2-T2Nx. Neoadjuvant RT 39/13, followed by Arm 1) surgery in 2 weeks vs Arm 2) surgery in 6-8 weeks. Sphincter preservation (primary endpoint) per surgeon
 * 17-years PMID 26723110 -- "Pathologic Response, When Increased by Longer Interval, Is a Marker but Not the Cause of Good Prognosis in Rectal Cancer: 17-year Follow-up of the Lyon R90-01 Randomized Trial." (Cotte E, Int J Radiat Oncol Biol Phys. 2016 Mar 1;94(3):544-53. doi: 10.1016/j.ijrobp.2015.10.061. Epub 2015 Nov 4.) Median F/U 17 years
 * Outcome: ypCR short 10% vs long 26% (SS). LR 14% vs 12% (NS). 5-year OS short 67% vs long 67%, 10-year OS 49% vs 53%, 15-year OS 40% vs 42%, 17-year OS 34% vs 34% (NS). Most recurrences (83%) within first 2 years, 96% within 5 years. Second malignancies 9.4% (4% were prostate/bladder)
 * Conclusion: Increasing interval between neoadjuvant RT and surgery did not effect survival, but it did not have a detrimental effect on local control.

 * Krakow (1999 - 2006) -- 1 week interval vs 4 week interval between neoadjuvant RT (25/5) and surgery
 * Randomized. 154 patients. Stage I-III (stage II 58%, stage III 25%). Neoadjuvant RT 25/5, followed by Arm 1) surgery 7-10 days vs Arm 2) surgery in 4-5 weeks. Surgery was TME and D3-lymphadenectomy
 * 5-years; 2012 PMID 22170083 -- "Randomized clinical trial on preoperative radiotherapy 25 Gy in rectal cancer--treatment results at 5-year follow-up." (Pach R, Langenbecks Arch Surg. 2012 Jun;397(5):801-7. doi: 10.1007/s00423-011-0890-8. Epub 2011 Dec 15.)
 * Outcome: No difference between type of surgery or sphincter preservation. LR short 1% vs long 7% (NS), all recurrences 14% vs 13% (NS). 5-year OS 63% vs 73% (NS). However, if downstaging after RT, survival 90% vs 60% (SS). Longer time interval resulted in higher downstaging 44% vs 13% (SS) but no effect on sphincter-sparing surgery or R0 resection (NS).
 * Conclusion: Longer time interval after neoadjuvant RT does not improve sphincter preservation. Improved 5-year OS seen only in patients with downstaging

Induction Chemo vs Adjuvant Chemo

 * Neoadjuvant chemo-RT followed by surgery, with either induction chemo strategy or adjuvant chemo strategy

 * Grupo Cancer De Recto 3, Spain (2006-2007) -- Induction chemo vs adjuvant chemo, with chemo-RT -> surgery
 * Randomized, Phase II. 108 patients, locally advanced rectal cancer, <12 cm from verge, LAR disease based on high-res MRI. Treated with chemo-RT followed by surgery. Randomized to Arm 1) Induction capecitabine 2000 mg/m2 and oxaliplatin 130 mg/m2 (CAPOX) x4 cycles vs Arm 2) Adjuvant CAPOX x4 cycles. Primary endpoint pCR
 * 2010 PMID 20065174 -- "Phase II, randomized study of concomitant chemoradiotherapy followed by surgery and adjuvant capecitabine plus oxaliplatin (CAPOX) compared with induction CAPOX followed by concomitant chemoradiotherapy and surgery in magnetic resonance imaging-defined, locally advanced rectal cancer: Grupo cancer de recto 3 study." (Fernandez-Martos C, J Clin Oncol. 2010 Feb 10;28(5):859-65. Epub 2010 Jan 11.)
 * Outcome: pCR induction 13% vs adjuvant 14% (NS), no difference in downstaging, tumor regression, R0 resection.
 * Toxicity: Higher during adjuvant arm. No difference during chemo-RT.
 * Conclusion: No difference in outcomes, but less toxicity with induction chemo compared with adjuvant chemo

 * Royal Marsden Hospital (abstract 163 at 2005 Gastrointestinal Cancers Symposium) - Chau I et al. - poor risk pts by MRI
 * 77 pts. MRI-staged poor risk (tumor within 1 mm of mesorectal fascia, T3 tumors at or below levators, T3c or T3d (??) at any other level, T4 tumors, or any tumor with 4 or more LN +).
 * 12 weeks neoadjuvant chemotherapy with Xeloda 1000 mg/m2 BID x 14 days q3w and oxaliplatin 130 mg/m2 q3w. At week 13, Xeloda 825 mg/m2 BID concurrent with XRT 45 Gy in 25 fractions + 9 Gy boost.  TME planned at 6 weeks after chemo/RT.  12 weeks post-op Xeloda 1250 mg/m2 BID x 14 days q3w.
 * 88% response rate after chemo. 97% after chemo/RT. At surgery, 79% had primary tumor downstaged. 98% had R0 resection. 24% had pCR and in 42% only microscopic tumor foci.  Median f/u 15.9 months.

Adjuvant Chemotherapy

 * Warsaw; 2010 PMID 20231300 -- "Does adjuvant fluoropyrimidine-based chemotherapy provide a benefit for patients with resected rectal cancer who have already received neoadjuvant radiochemotherapy? A systematic review of randomised trials." (Bujko K, Ann Oncol. 2010 Mar 15. [Epub ahead of print])
 * Systematic review. 4 trials
 * Outcome: No statistically significant benefit in patients undergoing preoperative radio(chemo) therapy for adjuvant chemo found
 * Conclusion: New trials should be launched

Organ Preservation

 * OPRA (Organ Preservation in Patients with Rectal Adenocarcinoma) Phase II trial - randomized to 1) FOLFOX then chemoradiation, or 2) chemoradiation then FOLFOX; then both groups got either TME or watch-and-wait based on tumor response
 * Randomized 324 patients, Stage II or III rectal adenocarcinoma, multi-center, USA
 * 2022 PMID 35483010 -- "Organ preservation in patients with rectal adenocarcinoma treated with total neoadjuvant therapy," (Garcia-Aguilar J, J Clin Oncol 2022)
 * Outcomes: 3-yr DFS 76% for both arms, 3-yr TME-free survival chemo-first 46%, ChRT 53%. DFS similar for TME at restaging or TME at recurrence.
 * Conclusion: "Organ preservation is achievable in half of patients with rectal cancer treated with total neoadjuvant therapy..."

Prognostic Factors

 * Meta-analysis; 2008 PMID 18182672 -- "What is the role for the circumferential margin in the modern treatment of rectal cancer?" (Nagtegaal ID, J Clin Oncol. 2008 Jan 10;26(2):303-12.)
 * 17,500 patients; importance of CRM. CRM predictor for local recurrence, distant mets, and overall survival
 * Conclusion: CRM involvement is one of key factors in rectal cancer treatment

 * Mt. Vernon, 2005 (UK) PMID 16199310 -- "Can histopathologic assessment of circumferential margin after preoperative pelvic chemoradiotherapy for T3-T4 rectal cancer predict for 3-year disease-free survival?" (Mawdsley S, Int J Radiat Oncol Biol Phys. 2005 Nov 1;63(3):745-52.)
 * Retrospective. 150 patients, treated with neoadjuvant CRT (5-FU/folinic acid), 6-12 weeks later excision. Median follow-up 25 months
 * Of 150, 122 patients (81%) curative resection, 98 patients (65%) negative margins R0.
 * Local recurrence: R0 10% vs. R1-R2 62%; DM: R0 29% vs. R1-R2 75%; DFS: R0 52% vs. R1-R2 9%
 * 3-year OS: R0 64% vs. R1-R2 25%
 * Conclusion : "After 5-fluorouracil-based CRT, a positive CRM (margin) predicted for a high risk of subsequent local recurrence and a 3-year disease-free survival rate of only 9%."

Side Effects

 * Swedish Rectal Cancer Trial
 * 1998 PMID 9593234 -- "Preoperative irradiation affects functional results after surgery for rectal cancer: results from a randomized study." (Dahlberg M, Dis Colon Rectum. 1998 May;41(5):543-9; discussion 549-51.)
 * Patient questionnaire. 171/220 patients alive >5 years.
 * Median BM frequency: RT 20/week vs. surgery alone 10/week (SS)
 * Fecal incontinence: RT 62% vs. surgery alone 27% (SS)
 * Impaired social life: RT 30% vs. surgery alone 10% (SS)
 * Conclusion: High dose preop RT influences long-term bowel function

 * Stockholm Trials
 * 2006 PMID 16532369 -- "Long-term effect of preoperative radiation therapy on anorectal function." (Pollack J, Dis Colon Rectum. 2006 Mar;49(3):345-52.)
 * Patient questionnaire. 64 patients (21 preop RT, 43 surgery alone). Mean F/U 14 years
 * Median BM frequency: RT 20/week vs. surgery alone 10/week (SS)
 * Fecal incontinence: RT 57% vs. surgery alone 26% (SS). Significantly worse resting and squeeze pressures
 * No difference in QOL between RT and surgery alone, but significantly worse for incontinent patients
 * Conclusion: short-term RT including anal sphincters impairs permanently anorectal function

 * German Rectal Cancer Study CAO/ARO/AIO (1995-2002) -- preop chemo-RT vs. postop chemo-RT
 * PMID 15496622 Full text, 2004 - "Preoperative versus postoperative chemoradiotherapy for rectal cancer." Sauer R et al. N Engl J Med. 2004 Oct 21;351(17):1731-40.
 * 823 pts. clinical stage T3-4 or N+. Randomized to 1) post-op regimen: surgery (TME) -> chemo/RT (55.8 Gy) -> 5 cycles bolus 5-FU, or 2) pre-op regimen: chemo/RT (50.4 Gy) -> surgery (TME) -> 4 cycles bolus 5-FU. In both arms, chemo was CVI 5-FU (1000 mg/m2/d) on days 1-5, weeks 1+5.
 * Sphincter-preserving surgery performed: 39% in pre-op arm, 19% in post-op arm
 * Grade 3-4 acute toxicity in 27% of pre-op arm, 40% of post-op arm (p=0.001)
 * Grade 3-4 long-term toxicity in 14% of pre-op arm, 24% of post-op arm (p=0.01)


text:
Ruby Programming/Notation conventions

Command-line examples
In this tutorial, examples that involve running programs on the command-line will use the dollar sign to denote the shell prompt. The part of the example that you type will appear bold. Since the dollar sign denotes your shell prompt, you should not type it in.

For example, to check what version of Ruby is on your system, run:

$ ruby -v

Again, do not type the dollar sign – you should only enter " " (without the quotes). Windows users are probably more familiar seeing " " to denote the shell prompt (called the command prompt on Windows).

An example might also show the output of the program.

$ ruby -v ruby 1.8.5 (2006-08-25) [i386-freebsd4.10]

In the above example, " " is printed out after you run " ". Your actual output when you run " " will vary depending on the version of Ruby installed and what operating system you are using.

Running Ruby scripts
For simplicity, the following convention is used to show a Ruby script being run from the shell prompt.

$ hello-world.rb Hello world

However, the actual syntax that you will use to run your Ruby scripts will vary depending on your operating system and how it is setup. Please read through the Executable Ruby scripts section of the ../Hello world/ page to determine the best way to run Ruby scripts on your system.

Running irb
Ruby typically installs with "interactive ruby" (irb) installed along with it. This is a REPL that allows you to experiment with Ruby, for example:

$ irb >> 3 + 4 => 7 >> 'abc' => "abc"

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Ruby Programming/Notation conventions


text:
Biological Psychology/Anatomy of the Nervous System

= Anatomy of the Nervous System =

= Divisions of the Nervous System =

Autonomic Nervous System
The autonomic nervous system controls all "automatic" functions, including visceral, endocrine, and homeostatic functions. It is divided into the sympathetic and parasympathetic nervous systems. The sympathetic system is thought of as the "fight or flight" system. Sympathetic activation involves dilation of the pupils and blood vessels, increased blood pressure, increased respiration, and a sense of "readiness". Stimulants engage this system and have similar effects. In contrast, parasympathetic activation involves contraction of pupils and blood vessels, decreased blood pressure, shallow breathing, and a sense of relaxation. Opiates engage this system. In general, the two systems balance each other, but there are exceptions.

= Cerebral Cortex = = Subcortical Anatomy =


text:
XForms/Relevant

Using Bind with the Relevant Attribute
XForms also allows you to conditionally display part of a form based on some value in your instance data. Typically this is used when the answer to one field of the form conditionally displays another part.

The format of this is to use the xf:bind statement within in the xf:model.

The following examples demonstrate this.

Link to Relevancy XForms Application
Relevancy Demos Note: RelevancySelector.xhtml in the example application is incomplete.

Bind to a Decimal
In the following example, the second input field is conditionally displayed based on the integer value of the first instance value.

Using Multiple Predicates in Binds
Sometimes you have a sequence of many items and the display of one item depends on the values of other items. Predicates are a way of appending AND/OR operations to the end of a path expression used as a relevancy expression.

The following example uses a bind with two predicates. The second item in a sequence is bound to the first item. To do this you must select the second item item[2] in the nodeset and add '''[. > 2.0] to end of the item[1]''' predicate.

    First item:

 Second item:

Bind to Boolean
Since parts of a form are usually either visible or not visible, it is natural to use a boolean value to determine if the field should be displayed.

In this example if InputIndicator is true, the second output instance is visible.

If the InputIndicator is false, the second output is not visible.

Note that expression  is used. This is a string comparison. Ideally you would just be able to test a node using mynoode=true but I have had problems with this method.

In this example, a simple checkbox is used to conditionally display a field.

In this example the type cast to boolean does not have any impact since relevant="/var/first=true" does not work as expected. String comparison must be used.

Binding a view to a select 1
This example shows how to conditionally display a view based on the value of a select1 control.      </xf:model> Demonstration of relevant fields. <xf:select1 ref="/data/select1value"> <xf:label>What view would you like to see? </xf:label>

<xf:item select="yes"> <xf:label>View 1</xf:label> <xf:value>1</xf:value> </xf:item> <xf:item> <xf:label>View 2</xf:label> <xf:value>2</xf:value> </xf:item> <xf:item> <xf:label>View 3</xf:label> <xf:value>3</xf:value> </xf:item> </xf:select1>

<xf:input ref="/data/view1"> <xf:label>First view: </xf:label> </xf:input> <xf:input ref="/data/view2"> <xf:label>Second view: </xf:label> </xf:input> <xf:input ref="/data/view3"> <xf:label>Third view: </xf:label> </xf:input>

Note that the functionally is similar to a <xf:switch> and <xf:case> combination but no <xf:toggle> is used.

The bind statement
The following line is the line that does the actual bind. You should use the instance function whenever you are binding one instance to another.

Also note that you must compare the text of the InputIndicator (the period) to true and not the InputIndicator itself.

An Architecture for Conditional Views and User-Maintainable Rules
Sometimes you need to have a consistent way of conditionally displaying views in a form. For example, if you want non-programmers to maintain the business logic of when a view is displayed, the binding rules to a view can be generated by an external rules engine.

To make this work you need to create a central instance that is used to control form views:

</xf:instance>

We call this architecture one of "Named Views" because an external tool can be used to state the rules of how any named view is rendered. This will be a central location in the form that generates the view instance and the binding expressions.

Each view is wrapped in a group element that binds the group to the instance in the view:

The display rules for each view can then be stored in a bind statement:

Each form can then have a "rules file" that looks similar to the following:

You can then build another XForms application that allows non-programmers to maintain these rules files and and a simple transform that places the instance and bind statements in the XForms model when it is loaded. The original groups may still need to be manually added to the form but once the views are added the rules can be maintained with a separate application.

Changing Fields to Display
The following example conditionally displays two zip code fields if the country code is 'usa" or displays a postal code if the field is not 'usa'.

</xf:instance> <xf:instance xmlns="" id="views"> </xf:instance> <xf:bind id="DisplayZipCode" nodeset="instance('views')/DisplayZipCode" relevant="instance('save-data')/CountryCode='usa'" /> <xf:bind id="DisplayPostalCode" nodeset="instance('views')/DisplayPostalCode" relevant="not(instance('save-data')/CountryCode='usa')" /> </xf:model> Demonstration of binding Zip Code Input <xf:select1 ref="instance('save-data')/CountryCode" selection="open"> <xf:label>Country:</xf:label> <xf:item> <xf:label>USA</xf:label> <xf:value>usa</xf:value> </xf:item> <xf:item> <xf:label>Canada</xf:label> <xf:value>can</xf:value> </xf:item> <xf:item> <xf:label>Mexico</xf:label> <xf:value>mex</xf:value> </xf:item> <xf:item> <xf:label>Other</xf:label> <xf:value>other</xf:value> </xf:item> </xf:select1> <xf:group bind="DisplayZipCode"> <xf:input ref="instance('save-data')/ZipCode" class="ZipCode"> <xf:label>Zip Code: </xf:label> </xf:input> <xf:input ref="instance('save-data')/ZipCodeSuffix" class="ZipCodeSuffix"> <xf:label>-</xf:label> </xf:input> </xf:group> <xf:input ref="instance('save-data')/LocationPostalID" bind="DisplayPostalCode" class="DisplayPostalCode"> <xf:label>Postal Code: </xf:label> </xf:input>

Delete
One of the most common occurrence of conditional display is the delete function for repeating elements. Typically you do not want to delete the last one. See the XForms/Conditional_delete example.

title: XForms/Relevant


text:
OpenGL Programming/GLStart/Tut2

Tutorial 2: Setting up OpenGL with Windows
Using the code from the first lesson (Win32 primer), we are going to set up the Windows program to work with OpenGL. First off, start up the Dev – C++ project that we worked on in the first lesson.

Linking the OpenGL libraries
When you open up your Windows project, go to the top menu bar and click on Project and then Project Options. In the Project Options window, click on the Parameters tab. Under the third window (the “Linker” window) click on the Add Library or Object button. From there navigate to where you installed Dev – C++ (most likely “C:/Dev-Cpp”). When you get there, open up the “lib” folder. In there click once on the libglu32.a file and then hold down the Control key and click on the libopengl32.a file to select them both. Then click the Open button on the bottom of the dialog. Then click the OK button:

Now, going back to your source code, right below the including of the windows header, put these include headers in:

 * 1) include
 * 2) include

These will include the appropriate OpenGL and GLU headers.

Contexts
Now we need to create two variables called Contexts. A context is a structure that performs certain processes. The two contexts that we are going to deal with are the Device Context and the Rendering Context. The Device Context is a Windows specific context used for basic drawing such as lines, shapes, etc… The Device Context is only capable of drawing 2- dimensional objects. The Rendering Context, on the other hand, is an OpenGL specific context used to draw objects in 3D space. The Device Context is declared with HDC and the Rendering Context is declared with HGLRC. Declare the two context variables like this right below the including of the headers:

HDC hDC; //device context HGLRC hglrc; //rendering context

We are now going to initialize both of these contexts so we can in the end draw something OpenGL related.

In the code, go to the message procedure (WinProc). Right now all we have is one message (WM_DESTROY). What we want is to create the contexts when the program is first opened. The windows message for that is WM_CREATE which is processed when the window first opens up:

case WM_CREATE:

Under that message we have to retrieve the current device context. To do that we set the regular Device Context (hDC) equal to the function GetDC which takes as one parameter the window handle which we declared at the WinProc declaration (hWnd). This function returns the current Device Context:

hDC = GetDC(hWnd);

For now we will leave the message like this. We will get back to this message later. What we need to do know is set up what is called the Pixel Format of the program.

Pixel Format
The Pixel Format is how, when drawing something, the pixels appear on the window. The structure that holds the pixel data is called the PIXELFORMATDESCRIPTOR:

typedef struct tagPIXELFORMATDESCRIPTOR { // pfd WORD nSize; WORD nVersion; DWORD dwFlags; BYTE iPixelType; BYTE cColorBits; BYTE cRedBits; BYTE cRedShift; BYTE cGreenBits; BYTE cGreenShift; BYTE cBlueBits; BYTE cBlueShift; BYTE cAlphaBits; BYTE cAlphaShift; BYTE cAccumBits; BYTE cAccumRedBits; BYTE cAccumGreenBits; BYTE cAccumBlueBits; BYTE cAccumAlphaBits; BYTE cDepthBits; BYTE cStencilBits; BYTE cAuxBuffers; BYTE iLayerType; BYTE bReserved; DWORD dwLayerMask; DWORD dwVisibleMask; DWORD dwDamageMask; } PIXELFORMATDESCRIPTOR;

There are a lot of fields here. The good thing is we only have to fill in a few fields in order to get this structure working. Lets start setting up the pixel format in a new function.

At the top of the code, add in this function call:

void SetupPixels(HDC hDC) {

The reason for taking as parameter a device context is because when we set the pixel format to be working with the window, we need to pass as a parameter to one of the functions the device context of the window.

Now, within the function we just created we declare a variable of type Integer called “pixelFormat”. This variable will hold an index that references the pixel format we are going to create. After that declare a variable of type PIXELFORMATDESCRIPTOR called “pfd” to hold the actual pixel format data:

int pixelFormat; PIXELFORMATDESCRIPTOR pfd;

Now lets start filling in a few of the fields of the pixel format.

The first field we fill in is the nSize field which is set to the size of the structure itself:

pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);

The next field we will fill in is the flags field called dwFlags. These set certain properties of the pixel format. We will set this to three flags. The first, PFD_SUPPORT_OPENGL, lets the pixel format to be able to draw in OpenGL. The next one, PFD_DRAW_TO_WINDOW, tells the pixel format to draw everything onto the window we provide. The final one, PFD_DOUBLEBUFFER, allows us to create smooth animation by providing two buffers to draw on, which get switched to make animation smooth:

pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;

The next field we will fill in is the version field, nVersion, which is always set to 1:

pfd.nVersion = 1;

The next field will be the pixel type, iPixelType, which sets the type of colors we want to support. For this we will use PFD_TYPE_RGBA so we get a red, green, blue, and alpha color set (don’t worry about the alpha part yet. We will go over that when the need comes):

pfd.iPixelType = PFD_TYPE_RGBA;

The next field, cColorBits, specifies the number of color bits to use. We will set this to 32:

pfd.cColorBits = 32;

The final field we set, cDepthBits, sets the depth buffer bits. For now set it to 24:

pfd.cDepthBits = 24;

After we set the fields of the pixel format, we need to set the device context to match the newly created pixel format. For this we use the ChoosePixelFormat function, which takes as the first parameter the device context and as the second parameter the address of the PIXELFORMATDESCRIPTOR structure we created earlier (pfd). We set the integer variable we declared at the beginning of the function (pixelFormat) equal to the return value of this function:

pixelFormat = ChoosePixelFormat(hDC, &pfd);

Now we set the pixel format to the device context with the SetPixelFormat function that takes as three parameters the device context, the pixel format integer, and the address of the PIXELFORMATDESCRIPTOR structure. Also, we will check to make sure this function worked. This particular function returns a Boolean value depending on whether it was successful or not. We will check if it was. If it was not successful, then we alert the user with a message box and close the program down:

if(!SetPixelFormat(hDC, pixelFormat, &pfd)) {         MessageBox(NULL,"Error setting up Pixel Format","ERROR",MB_OK); PostQuitMessage(0); }

Now we end the function since we are done setting up pixels:

}

Now we go back to the WM_CREATE message in the window procedure, and right under the obtaining of the device context (hDC = GetDC(hWnd)) we call the SetupPixels function and pass as the parameter the device context:

SetupPixels(hDC);

Now remember that rendering context we declared earlier (hglrc). Well, we will now create it using the wglCreateContext function which takes as parameter the regular device context:

hglrc = wglCreateContext(hDC);

Now we will make the rendering context the current one we will use throughout the program. For that we use the wglMakeCurrent function which takes as a first parameter the device context and the second parameter the rendering context:

wglMakeCurrent(hDC, hglrc);

Now we are finished with the WM_CREATE message. Make sure to include the break statement at the end of the message:

break;

Remember that WM_DESTROY message we created in the first lesson which is responsible for the exiting of the program? We need to release the rendering context there so there are no memory leaks. So go back to the WM_DESTROY message and we will add to the code there.

First, before we actually delete the rendering context, we have to make sure it is no longer active. For that we use the wglMakeCurrent function again. This function, if you remember, takes as parameters the device context and the rendering context. For this we pass the device context, but for the rendering context we put in NULL to indicate we don’t want the rendering context to be current:

wglMakeCurrent(hDC,NULL);

Now we are safe to finally release the rendering context. For this we use the wglDeleteContext function which takes as a single parameter the rendering context to delete:

wglDeleteContext(hglrc);

Make sure after these two function calls you still have the PostQuitMessage and the break statement as usual. Here is the whole WM_DESTROY message defined:

case WM_DESTROY: wglMakeCurrent(hDC,NULL); wglDeleteContext(hglrc); PostQuitMessage(0); break;

Window Resizing
Resizing happens when someone expands the width and/or height of the window. If we don’t control this, OpenGL will get confused and start drawing things out of whack. So first we will create a function called Resize that will handle the resizing of the window. This function will take as two parameters the width and height of the window, which I will discuss how we receive those parameters:

void Resize(int width, int height) {

The first thing we have to do in this function is called setting the viewport. The viewport is the portion of the window we want to see the OpenGL drawing going on. The function to set the viewport is called glViewport:

void glViewport(    GLint x,	      GLint y,	      GLsizei width,	      GLsizei height	     );

The first and second parameter, x and y, are the coordinates of the lower – left corner of the viewport. Since we want to see the drawing on the whole window, we set both of these to 0 indicating the lower –left corner of the window. The third and fourth parameter, width and height, is the width and height in pixels of the viewport. Since we want it to cover the whole window, we set it to the width and height parameters that were passed to the Resize function. Make sure to also cast the third and fourth parameters to the GLsizei data type just to be safe. So here is the glViewport function with the parameters filled in:

glViewport(0,0,(GLsizei)width,(GLsizei)height);

Now that we got the viewport set up, we need to set up what is called the projection. Projection is basically how the user views everything. There are two types of projection: Orthographic and Perspective. Orthographic is an unrealistic view. To better explain it, when an object is drawn in an orthographic 3D scene, the objects that are placed farther away from another object look like they are the same size, even with the distance taken into account. Perspective, on the other hand, is more realistic such as objects farther away appear smaller than objects closer to the viewer. Now that you got a better idea of projections, lets create one in code. We will use for this lesson the Perspective projection.

To start editing the projection, we need to select the Projection matrix. To do that we use the glMatrixMode function which takes as a single parameter the matrix we want to edit. To edit the projection matrix, we give the function the value GL_PROJECTION:

glMatrixMode(GL_PROJECTION);

Before we start editing the projection matrix, we need to make sure that the current matrix is the Identity matrix. To do that we call the glLoadIdentity function which takes no parameters and simply loads the identity matrix as the current matrix:

glLoadIdentity;

To set the perspective projection, we use the gluPerspective function:

void gluPerspective(  GLdouble fovy,   GLdouble aspect,   GLdouble zNear,   GLdouble zFar );

The first parameter, fovy, is the field of view angle in the y direction in degrees. You can set this to 45 to get a normal angle of view. The second parameter, aspect, is the field of view in the x direction. This is usually set by the ratio of width to height. The third and fourth parameters, zNear and zFar, is depth distance that the viewer can see. We set zNear to 1.0 and zFar to 1000.0 to give the user a view of a lot of depth.

Here are the functions with the aspect constraint options and all the main parameters filled in: gluPerspective(recalculatefovy,(GLfloat)width/(GLfloat)height,1.0f,1000.0f); float recalculatefovy {        return std::atan(std::tan(45.0f * 3.14159265358979f / 360.0f) / aspectaxis) * 360.0f / 3.14159265358979f; }    float aspectaxis {        GLFloat outputzoom = 1.0f; GLFloat aspectorigin = 16.0f / 9.0f; GLInt aspectconstraint = 1;    /* Sets the aspect axis constraint to maintain the FOV direction when resizing; the first constraint is conditional and maintains horizontal space if below a specific ratio and the other extends vertical space. Default is 0. */        switch (aspectconstraint) {            case 1: if (((GLfloat)width / (GLfloat)height) < aspectorigin) {                   outputzoom *= ((GLfloat)width / (GLfloat)height / aspectorigin) }               else {                   outputzoom *= (aspectorigin / aspectorigin) }            break; case 2: outputzoom *= ((GLfloat)width / (GLfloat)height / aspectorigin) break; default: outputzoom *= (aspectorigin / aspectorigin) }        return outputzoom; }

Now we have to switch the matrix mode to the model view matrix. Add another call to the glMatrixMode function, but this time with the parameter of GL_MODELVIEW. The model view matrix holds the object information which we will draw. I will get into more detail about it in later lessons:

glMatrixMode(GL_MODELVIEW);

Now we need to reset the model view matrix by calling the glLoadIdentity function. After that call, we are finished with the Resize function:

glLoadIdentity; }

Now we have to put this Resize function call in the Window Procedure. The message we will put it in is called WM_SIZE, which gets called whenever the window is resized by the user:

case WM_SIZE:

Now we need some way to keep track of the current window width and height. First off, declare two integer variables called “w” for width and “h” for height right before the switch structure for the messages:

int w,h; switch(msg)

Going back to the WM_SIZE message, we need to set the variables we just created to the current width and height. For this we use the lParam parameter that was passed to the Window Procedure function. To get the width of the window, you use the LOWORD macro function and put in as a single parameter the lParam variable. It will return the current width of the window. To get the current height of the window, use the HIWORD macro function, which will return the current height of the window. Finally, pass the two integer variables (w,h) to the Resize function we created and that will be the end of the WM_SIZE message:

case WM_SIZE: w = LOWORD(lParam); h = HIWORD(lParam); Resize(w,h); break;

Drawing something with OpenGL
Now that we got OpenGL set up with our program, lets test it out to make sure that it is set up right.

First create a new function called Render. This function will be responsible for all the OpenGL drawing done in this program:

void Render {

First thing we do in this function is called buffer clearing. I will discuss buffers in a later lesson, but make sure before you render anything on the screen that you clear the buffers you are using. For this we use the glClear function which takes as parameters the buffers we want to clear. We will put in GL_COLOR_BUFFER_BIT for the color buffer and GL_DEPTH_BUFFER_BIT for the depth buffer:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Now we have to load the identity matrix using the glLoadIdentity function so we can start fresh at the origin:

glLoadIdentity;

Right now up to this point, the view we have is centered about the origin and the whole window is 1 unit wide and 1 unit high. A unit is a type of measurement that OpenGL uses. This is basically a user – defined measurement system. The default window width and height is now 1 and 1 units. To gain more units on the window, we need to move along the z axis in the negative direction, meaning moving away from the viewer. All we want to do is move 4 units in the –z direction so the window is 4 units wide and 4 units high. For this we use the glTranslatef function:

void glTranslatef(    GLfloat x,	      GLfloat y,	      GLfloat z	     );

The parameters (x,y,z) specify what axis to move along. Since we want to move along the z axis negative 4 units, we leave the first two parameters as 0.0 and put in –4.0f for the z parameter:

glTranslatef(0.0f,0.0f,-4.0f);

Now we are finally going to draw something on the screen. First off, when drawing something on screen and you don’t specify a color for the object to draw, then OpenGL automatically makes the color of the object white. To fix this, before you draw any objects, use the glColor3f function which takes as three parameters the red, green, and blue color values. One thing you have to know is that the color values you can put in go from 0.0 to 1.0, not the usual RGB values which go from 0 to 255. For now we will set the color of the object we are going to draw to blue by setting the red and green values to 0.0 and the blue value to 1.0f:

glColor3f(0.0f,0.0f,1.0f);

Now we will finally get to the part where we actually draw something. How OpenGL drawing works is that first you have to specify what type of object you are going to draw. After that you specify the vertices of the object.

To start drawing objects, we need to use the glBegin function which takes as one parameter the type of object we are going to draw. The glBegin function tells OpenGL that the statements after this function call are going to be drawing specific. The parameter we will put for this function for now is GL_POLYGON which tells OpenGL that we are going to draw a polygon:

glBegin(GL_POLYGON);

Now we need to specify the vertices that we want connected to form the polygon. For this example, all we are going to draw is a square so all we need is to specify 4 vertices. To draw a vertex we use the glVertex3f function which takes as three parameters the x, y, and z location of the vertex. The OpenGL window initially was 1 unit wide and 1 unit high. Earlier in the Render function we used the glTranslatef function to move 4 units away. So that means that the viewing window is now 4 units wide by 4 units high. The origin starts at the complete center of the window and acts like a standard coordinate system. We will draw the first vertex close to the upper – right corner with the coordinate of (1.0f,1.0f,0.0f), meaning we place the vertex one unit to the right and one unit up:

glVertex3f(1.0f,1.0f,0.0f);

Now we will set the other four corners of the square just like we did with the first vertex:

glVertex3f(-1.0f,1.0f,0.0f); glVertex3f(-1.0f,-1.0f,0.0f); glVertex3f(1.0f,-1.0f,0.0f);

Now to end the drawing, we use the glEnd function to tell OpenGL we are done with drawing. That also finishes our Render function:

glEnd; }

Controlling the Render loop
Now we have to go back to the WinMain function and put the Render function somewhere that it will be called in a loop. First off, under the UpdateWindow function call in WinMain, we need to make sure we have the current device context using the GetDC function we used before:

hDC = GetDC(hWnd);

One other thing we do before we get to the render loop is clear the screen to a certain color. For this we use the glClearColor function which takes as 4 parameters the red, green, blue and alpha color values. Set these values to all 0 and put the function right under the previous GetDC function call:

glClearColor(0.0f,0.0f,0.0f,0.0f);

Now we are going to put the Render function in the WHILE loop we have at the end of WinMain. Right under the code while(1), put in the Render function:

while(1) {             Render;

The last thing we have to do before we compile this program is swap the buffers. Since we set the pixel format to be double – buffered we use the SwapBuffers function which takes as a single parameter a device context. Put this function call right after the Render function call:

SwapBuffers(hDC);

Now we are done writing the setup of OpenGL with Windows. Compile and run the program to get this output:

title: OpenGL Programming/GLStart/Tut2


text:
User talk:Gamerfrenzy

Okay there.

title: User talk:Gamerfrenzy


text:
User:Gamerfrenzy

I am gamerfrenzy. I am a programmer.

title: User:Gamerfrenzy


text:
OpenGL Programming/GLStart/Tut3

Tutorial 3: Drawing Primitives
Primitives are basic shapes that you can easily draw. It can be a triangle, a square, or even a single point. In this lesson we are going to learn how to draw some basic primitives including: points, triangles, and different polygons.

Immediate Mode
The easiest way to do drawing in OpenGL is using the Immediate Mode. For this, you use the glBegin function which takes as one parameter the “mode” or type of object you want to draw.

Here is a list of the possible modes and what they mean:

When you are done drawing all the vertices of the specific primitive, you put in the next line the glEnd function which ends drawing of that primitive.

Drawing Points
Lets do an example with the simplest mode, the GL_POINTS. When drawing points using OpenGL, the default size of the points is 1 pixel wide and high. This would be very hard to see when you run the program. To edit the size of the point you want to draw, you use the glPointSize function which takes as one parameter the size of the point you want.

Now in the Render function, before you write the glBegin code, we will set the point size to be 10 pixels in size:

glPointSize(10.0f);

After that, any drawing of points will be drawn 10 pixels wide and high. Now write the glBegin function with the GL_POINTS mode parameter. Then after that specify the vertices you want to use using the glVertex3f function. For this example, we want the upper – right corner (1.0,1.0,0.0) and the lower – left corner (-1.0,-1.0,0.0) of the screen to have a point. After drawing those two points, make sure to end the drawing with the glEnd function:

glBegin(GL_POINTS); //starts drawing of points glVertex3f(1.0f,1.0f,0.0f);//upper-right corner glVertex3f(-1.0f,-1.0f,0.0f);//lower-left corner glEnd;//end drawing of points

Here is the whole render function for your reference followed by a sample output. The whole code for this section of the tutorial can be found in the downloadable files. This example is called “points”:

void Render {         //clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity;//load identity matrix glTranslatef(0.0f,0.0f,-4.0f);//move forward 4 units glColor3f(0.0f,0.0f,1.0f); //blue color glPointSize(10.0f);//set point size to 10 pixels glBegin(GL_POINTS); //starts drawing of points glVertex3f(1.0f,1.0f,0.0f);//upper-right corner glVertex3f(-1.0f,-1.0f,0.0f);//lower-left corner glEnd;//end drawing of points }

Drawing a Line Loop
I would like to cover every single mode in the glBegin function, but it would take up too much time and space. So I will cover the advanced ones and most likely cover the other ones when they are deemed useful.

A line loop requires at least two vertices. Every vertex specified after that is connected to the vertex specified before it and the first vertex specified. So if we put a vertex to the left of the window, to the right of the window, on top and on the bottom, we would have a rotated square: Lets do this diagram in OpenGL. First we use the glBegin function and pass the parameter of GL_LINE_LOOP to tell OpenGL we are going to start drawing a line loop. Then we pass the four vertices to create the rotated square. The first vertex being to the left of the window (-1.0f,0.0f,0.0f), second one being at the bottom of the window (0.0f,-1.0f,0.0f), third at the right of window (1.0f,0.0f,0.0f), and the fourth and last being at the top of the window (0.0f,1.0f,0.0f). Then we make sure to put in glEnd to tell OpenGL we are done drawing the line loop:

glBegin(GL_LINE_LOOP);//start drawing a line loop glVertex3f(-1.0f,0.0f,0.0f);//left of window glVertex3f(0.0f,-1.0f,0.0f);//bottom of window glVertex3f(1.0f,0.0f,0.0f);//right of window glVertex3f(0.0f,1.0f,0.0f);//top of window glEnd;//end drawing of line loop

Following is the whole Render function followed by a sample output. Look for the project file called “lineLoop” on the downloadable file for this chapter:

void Render {         //clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity;//load identity matrix glTranslatef(0.0f,0.0f,-4.0f);//move forward 4 units glColor3f(0.0f,0.0f,1.0f); //blue color glBegin(GL_LINE_LOOP);//start drawing a line loop glVertex3f(-1.0f,0.0f,0.0f);//left of window glVertex3f(0.0f,-1.0f,0.0f);//bottom of window glVertex3f(1.0f,0.0f,0.0f);//right of window glVertex3f(0.0f,1.0f,0.0f);//top of window glEnd;//end drawing of line loop }

Drawing Triangles
Triangles are composed of three vertices. For this example we are going to use the regular GL_TRIANGLES mode to draw two triangles side by side.

First we want a triangle to the left. So we need three vertices on the left side representing one triangle and three vertices on the right side of the window representing the second triangle. Note that you don’t need two glBegin functions to draw two triangles. Since the mode GL_TRIANGLES is plural, it can handle more than one triangle in between one glBegin and glEnd function call:

Note that I wrote on the bottom – right corner of the diagram the coordinates of the vertices. Here is the code to draw these two triangles:

glBegin(GL_TRIANGLES);//start drawing triangles glVertex3f(-1.0f,-0.1f,0.0f);//triangle one first vertex glVertex3f(-0.5f,-0.25f,0.0f);//triangle one second vertex glVertex3f(-0.75f,0.25f,0.0f);//triangle one third vertex //drawing a new triangle glVertex3f(0.5f,-0.25f,0.0f);//triangle two first vertex glVertex3f(1.0f,-0.25f,0.0f);//triangle two second vertex glVertex3f(0.75f,0.25f,0.0f);//triangle two third vertex glEnd;//end drawing of triangles

Following is the whole Render function for this example followed by a sample output. To view the whole code, please see the “triangle” project folder in the downloadable files:

void Render {         //clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity;//load identity matrix glTranslatef(0.0f,0.0f,-4.0f);//move forward 4 units glColor3f(0.0f,0.0f,1.0f); //blue color glBegin(GL_TRIANGLES);//start drawing triangles glVertex3f(-1.0f,-0.25f,0.0f);//triangle one first vertex glVertex3f(-0.5f,-0.25f,0.0f);//triangle one second vertex glVertex3f(-0.75f,0.25f,0.0f);//triangle one third vertex //drawing a new triangle glVertex3f(0.5f,-0.25f,0.0f);//triangle two first vertex glVertex3f(1.0f,-0.25f,0.0f);//triangle two second vertex glVertex3f(0.75f,0.25f,0.0f);//triangle two third vertex glEnd;//end drawing of triangles }

Drawing Polygons
Polygons consist of at least three vertices that, when connected, make up a shape. In this example we are going to be using the GL_POLYGON mode to draw a six – sided shape.

The GL_POLYGON mode allows you to draw a shape with any number of sides as you want. Since GL_POLYGON is a singular word (meaning no “S” at the end of the word), you can only draw one polygon between a glBegin and glEnd function call. Also, the last vertex you specify is automatically connected to the first vertex specified. And of course, since a polygon is a closed shape, like the triangle, the shape will be filled with your specified color (which for now is blue). Here is the diagram for our six – sided shape:

(note: this can't be used for concave polygons)

Here is the code to draw this polygon:

glBegin(GL_POLYGON);//begin drawing of polygon glVertex3f(-0.5f,0.5f,0.0f);//first vertex glVertex3f(0.5f,0.5f,0.0f);//second vertex glVertex3f(1.0f,0.0f,0.0f);//third vertex glVertex3f(0.5f,-0.5f,0.0f);//fourth vertex glVertex3f(-0.5f,-0.5f,0.0f);//fifth vertex glVertex3f(-1.0f,0.0f,0.0f);//sixth vertex glEnd;//end drawing of polygon

Following is the whole Render function followed by a sample output. Look for the whole code in the “polygon” project folder on the included downloadable files:

void Render {         //clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity;//load identity matrix glTranslatef(0.0f,0.0f,-4.0f);//move forward 4 units glColor3f(0.0f,0.0f,1.0f); //blue color glBegin(GL_POLYGON);//begin drawing of polygon glVertex3f(-0.5f,0.5f,0.0f);//first vertex glVertex3f(0.5f,0.5f,0.0f);//second vertex glVertex3f(1.0f,0.0f,0.0f);//third vertex glVertex3f(0.5f,-0.5f,0.0f);//fourth vertex glVertex3f(-0.5f,-0.5f,0.0f);//fifth vertex glVertex3f(-1.0f,0.0f,0.0f);//sixth vertex glEnd;//end drawing of polygon }

Display Lists
Using the OpenGL immediate mode has several drawbacks. For example, vertex data must be transferred on the fly to the graphics memory whenever drawing. This can be improved by using Display Lists. Display Lists essentially take a glBegin/glEnd command sequence and store that on the graphics card side in an efficient manner.

(todo: elaborate on that later, see for some infos - glGenLists, glNewList, glEndList, glCallList, glDeleteLists)

Vertex Arrays and Vertex Buffers
Display Lists also have drawbacks. Once compiled, Display Lists are static, and cannot be changed. Also, vertices shared by several primitives still need to be represented and transformed multiple times when drawing. This is very inefficient.

These problems are addressed by Vertex Arrays and Vertex Buffers. The idea is simply to use arrays to store vertex data. Using glDrawArrays, primitives using these vertices can be drawn.

For storage of data in video memory, Vertex Buffers can be used (glGenBuffer, glBindBuffer, glBufferData, glDeleteBuffers). Two types of Vertex Buffers exist:
 * GL_ARRAY_BUFFERs hold actual vertex data.
 * GL_ELEMENT_ARRAY_BUFFERs hold indices to vertices stored in a separate GL_ARRAY_BUFFER and, thus, allow reusing vertices in several primitives.

(todo: elaborate on that later, example)

title: OpenGL Programming/GLStart/Tut3


text:
Piano/Reading Music

Music originated a long time ago. The first notations were random dots on a page. We cannot tell the pitch of them. Slowly, it developed into one line, then the grand staff we see today.

Reading Music
'''Music Notation is needed for the player to indentify what key to play at what time. ''' Learning how to read music is an essential part of playing the piano. If you don't know how to read music, you may be stuck trying to learn a difficult song by ear, which can be made much easier by reading the sheet music. Music is read by lines. There are 5 lines on a clef, with 2 sets of these for the piano.

The upper clef is known as the treble clef or G clef, and the lower clef is the bass clef or F clef. There are a lot of notes to associate with their particular piano keys, and that can seem overwhelming when first learning to read sheet music.

Mnemonics
Notes are considered in 3 parts: the notehead, the stem, and optionally the flag.

In the treble clef the first line from the bottom is E, the second line is G, then B, D, and F. Different mnemonics exist, one is Every Good Boy Does Fine, a second is Every Girl Buys Designer Fashions, a genderless version is Elephants Get Big Dirty Feet. You may also make your own. The spaces are F, A, C, E, which spells the word FACE.

In the bass clef the first line from the bottom is G, the second is B, D, F, and A. One mnemonic is Good Burritos Don't Fall Apart. The spaces are A, C, E, G. One mnemonic is All Cows Eat Grass.

title: Piano/Reading Music


text:
User:Keytotime/Temp

This is my private draft page.

 * 1) Combining Transformations of Graphs

The Mole
In chemistry it is impractical to ask for a specific number of a substance, therefore the mole has been established. The mole (unit: mol) is defined as the same number of elementry units of a substance as there are atoms in exactly 12g of pure Carbon 12. The mass in grams of one mole of a substance is it's the molar mass. Since the atomic mass is also relative to Carbon 12, the atomic mass of an element is the molar mass of one mole of the element.

Calculus

 * $$\lim_{x\rightarrow 0}\frac{\sin(x)}{x}=1,$$
 * $$\lim_{x\rightarrow 0}\frac{1-\cos(x)}{x}=0$$

title: User:Keytotime/Temp


text:
GIMP/Blending Exposures

Digital Cameras are limited in their abilities to capture scenes with a large dynamic range. They are especially prone to blown out highlights, losing all detail in bright areas. This How to will demonstrate a method for capturing pictures and then processing them with the gimp to create a picture with more dynamic range that a normal picture. This will involve taking the picture and then combining them back into one picture using the gimp.

Auto Exposure Bracketing
We will use Auto Exposure Bracketing to create 3 differently exposed pictures. The first picture will be a normal exposure, the second one will be an underexposure containing the highlights, and the third one will be an overexposed picture containing the shadows.

You will need a tripod or another stable surface. It is very important that the camera does not move a single nanometre during the 3 exposures. Compose the frame in the viewfinder, then activate auto exposure bracketing. Then take the 3 pictures without moving the camera in between shots, preferable with a remote to avoid pressing the shutter button.

The results should look like this:

Editing With The Gimp
Open the middle exposure picture. From the File menu, select Open as Layers (default shortcut Ctrl+Alt+O) and shift-click to select both the dark and the bright exposure variants of the picture. This will add two layers, which you might want to rename to "light" and "dark" for example.

My images aren't perfectly aligned. Not sure why, maybe it has something to do with my tripod being on soft ground. Show only the underexposed and regular layer, and set the underexposed layer to partial transparency. Then zoom to 800% and move the underexposed layer until it is aligned with the regular exposure. Tap the arrow keys to move the layer one pixel at a time. You can try temporarily setting the mode of the dark layer to Divide or Difference; this will give strong contrast at unaligned edges (a high opacity will make the effect stronger). Repeat on the overexposed layer.

Now duplicate the background layer.

Now use the threshold tool on the duplicated layer to make the overexposed areas pure white (  Tools>Color Tools>Threshold...).

Add a layer mask to the underexposed layer. Cut the threshold that you just created and paste it onto the layer mask. (The layer mask is the rectangle in the layer dialogue to the right of the layer thumbnail.) With only the underexposed layer and regular layer, it should look like this:

The image looks rough at this point. To fix this select the layer mask and apply a Gaussian blur to it. I used a radius of 50px. The needed strength of the Gaussian blur will depend on the image so experiment with this value. This will ease the transition between the 2 images. It should now look like this:

Repeat with the overexposed image. The final image should look like this:

title: GIMP/Blending Exposures


text:
Talk:Blender 3D: Noob to Pro/Image Textures

Maybe
We could put something up here thats has to do with procedural textures IN BLENDER, instead of just what tey are? This book really falls apart near the end

PLZ help
I'm trying to make a globe... that is, a sphere with a map on it, but the map won't cover the whole thing and on the other side, it's reversed!!! Help!!! :O 74.185.212.232 (talk) 14:55, 13 April 2009 (UTC)

gah what a let-down
the last section is titled "Mapping an Image Texture to an Object" but it never actually explains how to do the the title implies. As the guy above said, this page falls apart at the end. It was good until here. What a disappointment. 93.233.101.104 (talk) 01:43, 30 November 2010 (UTC)
 * I agree, very disappointing. This was one of the most important steps in what I was hoping to be able to do, too... Hoping someone will come along soon and re-write the page with all the missing info filled in. The only step I can't complete is changing the texture type to an Image texture - I think the rest is manageable with the existing info, but I can't for the life of me figure out how to do that one simple step... 75.165.70.161 (talk) 02:24, 3 January 2011 (UTC)

 * I have to agree with the gripes regarding "Mapping an Image Texture to an Object". Not only do the instructions not make much sense, they appear to be sorely outdated as the hot key presses don't produce any selectable options. Images would really help to give the reader some idea of whether they're on the right track or not.66.68.135.122 (talk) 20:18, 7 February 2012 (UTC)

this video explains
this video explains it in a round about way but still does a better job then the page

http://www.youtube.com/watch?v=obB9T3jXlak

hopefully fixed
I felt the same way... the explanation did not work... but I already saw the above mentioned video and tested and rewrote a new explanation... so HOPEFULLY that will fix the page. It's not advanced with UV mapping or scaling or anything, but it's appropriate for the early section of the book.


text:
Practical Electronics/Packages

Many electronic components are made of the functioning electronic part and a package to protect and support the working bit. There are hundreds of different packages, each with specific uses, advantages and disadvantages.

All packages have a "body", usually made of plastic or ceramic and occasionally metal, and "pins" to connect the internal workings to an external circuit.

This page lists packages by components type, with basic dimensions and links to more specific pages with package dimensions, PCB footprints, etc.

Semiconductor Devices
Semiconductor devices are labelled according to the JEDEC prefix convention:

 * MO: microelectronic outline
 * TO: transistor outline
 * DO: discrete outline

Where applicable, the alternative names for the same package as given by JEITA or the common abbreviation (for example, DIL for dual in-line) will be noted, as well as the category of package (for example, "flange mounted, rectangular base").

Transistors
Transistors also have a column for the kind of lead. Axial leads are lead which follow the axis of the transistor, that is, perpendicular to the seating plane. Flat leads are parallel to the seating plane.

title: Practical Electronics/Packages


text: Template:No

title: Template:No


text: Template:Yes

title: Template:Yes


text:
Template:Thm

style="background: #ddffdd" align="center"|

This template is designed to be used in tables for electron package information. Its purpose is to make a cell with "Thm" (For "Through-hole Mounting") in that cell, with a green background. It is the counterpart to the Smt template.

Example:

title: Template:Thm


text:
Template:Smt

style="background: #ffdddd" align="center" |

This template is designed to be used in tables for electron package information. Its purpose is to make a cell with "SMT" (For "Surface mount technology") in that cell, with a red background. It is the counterpart to the THM template.

Example:

title: Template:Smt


text:
GIMP/Levels

The levels tool is an easy and powerful tool for adjusting the tones of an image. It allows more precise control of contrast than the Brightness-Contrast tool, but doesn't give the user the complete control of Curves.

Input Levels
Input levels control the contrast of the picture. The end points control the black points, and the white points. The eyedropper buttons next to the black and white input level markers allow black and white points to be selected in the image. The middle pointer can be used to selected the gamma correction value for the image.

This tool can be used to simulate setting a white point. For images such as Image:PSF B-70002.png, setting a white point is critical in extracting useful images such as Image:Backstroke (PSF).png.

title: GIMP/Levels