顯示具有 待完成 標籤的文章。 顯示所有文章
顯示具有 待完成 標籤的文章。 顯示所有文章

2021年6月8日 星期二

[放射物理] nuclear transforms

在放射物理教科書 Khan 裡面, 第二章主要討論Nuclear transformation, 這章的重點在於放射物質的衰變以及各種核反應(nuclear reaction)

首先要先了解radioactivity是甚麼, 中文翻譯為放射性, 意思是輻射從原子裡面釋放出來, 這裡的輻射可以是粒子輻射, 電磁波, 或者兩個都放出來!


輻射衰變

輻射衰變可以用一個公式來做描述, 其實這個在普通物理學也有出現過, 就是以下這個公式:

$ N=N_{0}*e^{(-\lambda*t)} $

其中$N$為時間為t的時候的放射性原子總數, $N_{0}$ 為一開始的放射性原子總數, $\lambda$為衰變常數, e 為自然數, 值大概是2.718


活度

在來就是介紹活度(activity)的部份, 其實就是把上面的公式兩邊同時作微分, 可以得到

$ \dfrac{dN}{dt} = N_{0}*(-\lambda)*e^{(-\lambda*t)}$

其中我們把$ -\dfrac{dN}{dt} $ 定義為活度(activity), 則上面的式子可以寫成

 $ A = A_{0}*(e^{-\lambda*t}) $ 

因為 $ A_{0}= N_{0}*(\lambda) $ ($ A= \lambda*N $)

(P.S. Khan's physics的推導很類似, 不過把負號的處理省略掉)

接下來是單位的部分, 活度的單位是 Curie (Ci), SI制的話會寫作Bacquerel (Bq), 其中

$ 1 Ci = 3.7*10^{10} Bq$; 1 Bq = 1dps (1 dps 表示一秒衰變一次 )

半衰期(half life) 跟平均壽命(mean life)

半衰期(half life): 定義為放射性物質的活性或是原子數目衰變到原本的一半所需要的時間

其實也是可以從第一個公式去做推導, 

$ N=N_{0}*e^{(-\lambda*t)} $

$ 把 N 設成 \dfrac{N_{0}}{2}$, 帶入上面的算式

$ \dfrac{N_{0}}{2} = N_{0}*e^{(-\lambda*T_{1/2})} $, 兩邊取ln, 則算式會變成

$ T_{1/2} = \dfrac{ln 2}{\lambda}$, 就是 $ T_{1/2} = \dfrac{0.693}{\lambda}$

平均壽命 (mean life): 定義為放射性物質在完全衰變前的平均壽命, 上面的定義實在太繞口, 其實值就是$ T_{a} = \dfrac{1}{\lambda}$, 推導上也不難, 其實際就是假設活度不會變, 值固定為$ A_{0}$, 則$ T_{a} = \dfrac{N_{0}}{A_{0}}$, 故$ T_{a} = \dfrac{1}{\lambda}$

至於為什麼要有這個定義, 原因就是因為在永久性插種(permanent implant)去做射源劑量計算的時候, 使用平均壽命可以方便我們去計算放射性物質會衰變幾次, 進而得知總劑量

練習題: 107 年第一次國考 醫學物理學與輻射安全



解答: 直接利用圖表內插得知, 半衰期大概 2.7 左右, 又平均壽命為半衰期/0.693 => 所以答案選B



利用平均壽命的概念可以解答這題,  

一開始的劑量率為10μSV/h => 所以可以得知從一開始衰變到最後的總劑量為
10 μSV/h* ((5.3 yr*365 d/yr *24 h/d)/0.693) * 0.001 = 670mSV

5.3 年後的劑量率為5SμV/h => 所以可以得知從5.3年後衰變到最後的總劑量為
5 * (5.3*365*24/0.693) * 0.001 = 335 mSV

所以上下相減 => 335mSV

輻射衰變系列(radioactive series)

原子衰變有以下幾個系列: uranium series, actinium series 以及 thorium series

輻射衰變平衡(radioactive equilibrium)

輻射衰變會由母核(parent nuclide)衰變成子核(daughter nuclide), 而子核自己也會進行衰變, 滿足某些條件的情況下, 子核的活度跟母核的活度比值會形成定值, 就是所謂的輻射衰變平衡, 可以分成以下兩種:

瞬時平衡(transient equilibrium): 母核半衰期大於子核半衰期 (Mo-99 變成 Tc-99m)

長期平衡(secular equilibrium): 母核半衰期遠大於子核半衰期(Ra-226 變成 Po-218), 在達到長期平衡的時候, 母核的活度跟子核的活度會一樣

Khan physics 裡面有詳細推導, 這裡略表不提

輻射衰變的模式

輻射衰變有以下幾個模式, 包括 alpha particle decay, beta particle decay, electron capture 跟 internal conversion

1. alpha particle decay: 在質量數大於82的原子很常進行alpha particle decay, 就是釋放出氦核跟能量Q, 可以寫成如下的反應式

$ {}^{A}_{Z}X $ -> $ {} ^{A-4}_{Z-2}Y $ + $ {}^{4}_{2}He $ + $ Q $

2. beta particle decay: 釋放出正電子或者是負電子的輻射衰變反應, 可以再依照放出正負電子的不同, 分為 beta minus decay 以及 beta plus decay 

其中beta minus decay 的反應式如下:
$ {}^{1}_{0}n $ -> $ {} ^{1}_{1}p $ + $ {}^{0}_{-1}\beta $ + $\bar{\nu}$

其中 $n$ 為中子, $p$ 為質子, $\bar{\nu}$ 為 anti-neutrino(反微中子)

而beta plus decay 的反應式如下: 通常是發生在n/p ratio比較不夠的原子, 藉由這個反應可以增加 n/p ratio
$ {}^{1}_{1}p $ -> $ {} ^{1}_{0}n $ + $ {}^{0}_{+1}\beta $ + $\nu$

其中 $n$ 為中子, $p$ 為質子, $\nu$ 為neutrino(微中子)
而beta-plus decay 就是正子攝影的原理

3. electron capture(電子捕獲): 就是軌道電子被原子核捕獲, 把質子轉變成中子,反應式如下, 是除了上面的提到的beta plus decay外, 另外一種可以提高n/p ratio的方法:
$ {}^{1}_{1}p $ -> $ {} ^{0}_{-1}e $ + $ {}^{0}_{+1}n $ + $\nu$

發生電子捕獲之後, 在軌道上會產生空洞, 更外層的電子會去佔據那個空洞, 產生特性輻射(characteristic x-ray). 原子如果吸收特性輻射, 把軌道電子釋放出去的話,這樣的效應被稱作內光電效應(internal photoelectric effect), 放出的電子被稱做鄂惹電子(Auger electron); 一般來說Z<30 比較有機會放出Auger electron, 高Z的元素大部分放出特性輻射

4. internal conversion(內轉換): 處於激發態的原子, 把多餘的能量給軌道電子, 軌道電子被彈出, 之後外層電子跑到剩下來的空洞, 放出特性輻射或者是產生Auger electron
核反應
1. $\alpha$,$p$ reaction:
就是拉賽福(Rutherford)在1919年進行的經典實驗, 用氦核去撞擊氮氣, 會產生以下反應
$ {}^{14}_{7}N $ + $ {} ^{4}_{2}He $ -> $ {}^{17}_{8}O $ + $ {}^{1}_{1}H $ + $ Q $
其中Q為放出或吸收的能量

2. $\alpha$,$n$ reaction
用$\alpha$粒子去撞擊原子核, 進而產生中子

3. Proton bombardment

4. Deuteron bombardment

5. Neutron bombardment

6. photodisintegration
粒子吸收光放出中子 以銅為例 需要至少10.86MeV的光才能引發光聚裂變 臨床上的應用就是直線加速器如果能量超過10MeV 就可能放出中子

7. fission

8. fusion


reference:

1. Khan's the physics of radiation therapy chapter 2

2. The physics and technology of radiation therapy 2nd edition

[放射物理] Khan chapter 1

 其實之前有大概整理過, 連結在此, 之後有空會再來補得更完整

2019年12月13日 星期五

[大腸直腸癌] 治療介紹

大腸直腸癌在飲食日漸西化的台灣, 可以說是一個常見的癌症, 這裡一樣也是參考知名醫學期刊Lancet的review以及NCCN guideline來做個整理

一. screening(篩檢):

目前台灣國健署補助五十歲到七十四歲的民眾, 兩年進行一次定量免疫法糞便潛血檢查

二. risk factor(危險因子):

1. 男性, 年齡增加
2. 生活習慣: 抽菸喝酒, 吃重組肉和紅肉,少吃蔬菜水果, 身體肥胖會增加大腸癌機率
3. 家族遺傳: hereditary colorectal cancer syndromes, positive family history
4. 藥物使用: aspirin, NSAID, menopausal hormone therapy, statin
5. 疾病: 糖尿病, 發炎性腸疾病

三. 致病機轉: 大腸直腸癌在致病機轉這方面研究的非常多

1. 病理上來看: 通常是由aberrant crypt(異常的隱窩), 變成polyp, 之後再變成癌症, 這個過程大概要十到十五年

2. 分子機轉: 這篇論文列出三種:

(1) adenoma-carcinoma pathway(70-90%)
(2) serrated neoplasia pathway(10-20%)
(3) Microsatellite instability(2-7%)

3.  left side v.s. right side colorectal cancer:

(1) right side colorectal cancer: cecum+ascending colon + transverse colon, 在胚胎學上為midgut的衍生物, 預後較差

(2) left side colorectal cancer: descending colon + sigmoid colon + rectum 在胚胎學上為hindgut的衍生物, 預後較好

四. 診斷:

1. colonscopy(大腸鏡): 做檢查看病兆以及做切片

五. 分期:

1. AJCC 8:

T 分期: 由侵犯深度決定
N 分期
M 分期

六. 治療:

1. 內視鏡切除: 針對比較小比較早期的腫瘤

2. 手術切除: 標準治療, 其治療準則被稱作complete mesocolic excision priciple, 不過取淋巴結的方式目前還沒有定論; 至於針對rectal cancer 的術式被稱為TME(total mesorectal excision)

3. 放射治療: 針對直腸癌, 前導性的放射治療(neoadjuvant CCRT or short course RT)是可以被考慮的, 目的是讓腫瘤變小, 讓之後手術比較好處理以及希望保護病人更多的腸道

4. 系統性治療: 這塊目前發展的很迅速

七. 直腸癌的放射治療:

因為小弟是放腫科的, 因此對於直腸癌的放射治療特別需要著墨XD, 目前有三種作法:

1. short course RT(25Gy/5Fr) -> 開刀
2. short course RT -> chemotherapy -> 開刀
3. neoadjuvant CCRT(45Gy/25Gr - 50.4Gy/28Fr) -> 開刀

=> 2021更新: 目前NCCN guideline 建議使用Total neoadjuvant therapy 的作法, 希望將本來在術後進行的化療移到手術前施打, 因此上面的作法已經有所更動, 有機會來寫一篇更新的!

reference:

1. Lancet. 2019 Oct 19;394(10207):1467-1480. doi: 10.1016/S0140-6736(19)32319-0.

2. https://www.hpa.gov.tw/Pages/Detail.aspx?nodeid=621&pid=1136

3. https://training.seer.cancer.gov/colorectal/anatomy/layers.html


2017年10月15日 星期日

Octave/Matlab 介紹

Matlab 是一套理工科常用的數學軟體, 功能極端強大, 但缺點是需付費, 不過開源軟體社群開發出一套免費的軟體Octave,其指令可以涵蓋matlab, 非常好用, 下載地址:octave

p.s. 本文用>>取代原本開頭(ex. octave:1>) ,來方便簡化
其指令為 PS1('>> ')
指令教學:

1. 繪圖

(1)二維繪圖:
>> x=[1,2,4,6,8]
>> y=[3,4,6,7,9]
>> plot(x,y)

圖案如下:
其實還蠻漂亮的XD

2. vector:

(1) row vector:
>> v=[1 2 3]
v=
      1  2  3

(2) column vector:
>>v=[1;2;3]
v=
      1
      2
      3

3.  matrix 運算:
(1) matrix 宣告

>> A=[1 2 ; 3 4 ; 5 6]
A=
        1  2
        3  4
        5  6

(2) matrix transport
>> A'
A=
        1  2  3
        4  5  6

4. control statement:

(1) loop:
>> for i=1:5,
> v(i)=i;
> end;
> v
v=
      1  2  3  4  5

5.  其他功能

(1) 如果需要加註解, 利用%符號
>> 6+7   % 6 add 7
13

(2)  如果不知道這個指令如何使用,可以在指令前面加help
>> help help % 查詢help指令如何使用

(3) linux 的許多指令也能使用,例如pwd, ls, cd


reference:
1. https://www.gnu.org/software/octave/
2. Machine learning by andrew ng
3. mathwork
4. Octave

2017年8月22日 星期二

git 指令整理

git 是一個非常流行的版本控制系統(version control system),何謂版本控制系統呢?
就是我們在程式開發時,常常會遇到一種情形,就是不知道更動這段程式碼會發生甚麼bug,有時加了一些新功能後,才發現bug跑出來,於是想回到之前的版本,這時版本控制系統就派上用場了!
以上是單人開發時的情況,多人開發時情況更複雜,常常會有檔案蓋來蓋去,不知道對方做了甚麼,這時版本控制系統就更重要了啊!

git 內部有三個結構

Working tree  ----> staged area ---> repository(內有commit)
                     git add                 git commit
為何要有staged area呢,這是因為如果沒有staged area的話,你對working tree內做的所有改變就會在你commit後,全部跑到repository內,為了更好的做到版本控制,所以才會有staged area

git 還有一個重要概念: branch
在中文裡,branch是分支的意思,在程式設計時,如果我們想實驗程式碼,又不想動到目前的程式碼,可以新增一個新的branch,指令如下: git branch  branch名稱


以下是git 的常見指令整理:

1. git clone :複製檔案
可從網路連結抓取檔案

2. git init: 在目前的位置建立一個新的repository

3. git log : 把目前repository 的所有commit 歷史都叫出來,但有時會太長,可按q跳出

4. git status: 顯示work tree 的歷史

5. git branch: 產生新的branch(但並未轉至這個branch,若須轉到這個branch,要用git checkout)

6. git checkout : 將目前檔案回到某個commit狀態 or 轉換到某個branch

7. git diff :有三種用法

(1) git diff  commit ID1 commit ID2 :比較兩個commit的不同
(2) git diff : 比較  working tree 和 staged area
(3) git diff --stage: 比較 staged area 和most recently commit

8. git merge: 合併branch和master =>可能會產生merge conflict=>需手動處理

merge conflict: 大家動到同一個檔案 電腦不知道誰的才是對的

reference:
1. udacity
2. git help
3. https://git-scm.com/docs/git-merge

2017年7月31日 星期一

leetcode-23 Merge k Sorted Lists

題意:合併k個已排序的linkedlist

解題思路:這題我是把全部的元素丟進c++ stl 的priority queue裡,能通過測試,但時間和空間複雜度太大,但我還是先貼我過的code,待我之後再刷到這時,再更新更快做法

效率更高做法: http://bangbingsyb.blogspot.tw/2014/11/leetcode-merge-k-sorted-lists.html

C++ code:

/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode(int x) : val(x), next(NULL) {}
 * };
 */
class Solution {
    
public:
     struct cmp 
     { 
        bool operator()(ListNode* x,ListNode*  y) 
        { 
            return x->val > y->val; 
        } 
     }; 
    ListNode* mergeKLists(vector<ListNode*>& lists) {
        
        priority_queue<ListNode*, vector<ListNode*>, cmp> pq;
        int len=lists.size();
        
        for(int i=0;i<len;i++)
        {
            ListNode* par=lists[i]; 
            while(par!=NULL)
            {
                pq.push(par);
                par=par->next;
            }
        }
        ListNode* ori=new ListNode(0);
        ListNode* cur=ori;
        while(!pq.empty())
        {
            cur->next=pq.top();
            pq.pop();
            cur=cur->next;
            
        }
        cur->next=NULL;
        return ori->next;
    }
};

2017年6月28日 星期三

2017年6月23日 星期五

useful computer science open course

1. computer science theory:


(1) algorithm and data structure:


a. algorithm(from NCTU in Mandarin): cover the basic of algorithm, move in a reasonable pace,can be used as the first course in algortihm


b. Introduction to Algorithms(MIT): one of the lecturer is the author of the introduction to algortihm(CLRS), so you should use it with the algorithm bible(CLRS), and you will find it is really useful. However, the material is somewhat hard, maybe this should be your second OCW of data structure and algorithm


c. Computational Geometry(from edx in Mandarin): a good course on computatational geometry, use the beatiful picture to cover the core concept of the algorithm


d. Algorithms on Strings(coursera): week 3 is a good tutorial of the KMP algorithm


(2) linear algebra:


a. Linear Algebra(MIT): teach by the world-famous professor, Gilbert Strang, this course is fun and easy to understand, this course emphasize to build your math sence without too much proof, highly recommended


(3) discrete math:


a. Mathematics for Computer Science(MIT): a great course covers many aspect of computer science, even cover the Akra-Bazzi theorem


(4) computer architecure:


a. computer organization(from NTHU in Mandarin): this course covers the key concept of the subject bible,"computer organization and design",the professor keeps asking question to the student, also help the viewer to think about the logic behind computer design, highly recommended!

(5) operating system:


a. Operating Systems(from sharecourse in Mandarin): use the slide from the most popular OS book,"Operating system concepts", the professor almost cover all the material of the first 2/3 part of the book, highly recommended!

(6) artificial intelligence:


a. Intro to artificial intelligence(from Udacity): offered by Stanford, and one of the lecturer, Peter Norvig, is the author of the AI bible,"Artificial Intelligence:Modern approach", this course is base the book. Excellent course with easy-understanding teaching, highly recommended.

b. learning from data(from Caltech): offered by Caltech, a really good introduction to machine learning, highly recommended. If you got the companion textbook, "Learning from data, a short course", the learning process will be faster!! 

(7) database:


a. databases (Stanford): currently viewed as the best DB class on the internet, highly recommended.

2. programming language:

(1) c/c++:


a. C++ Programming (from edx in Madarin): very thorough course in C++, go from the basic to very deep concept, cover OOP, STL.

(2)Java:


a.Intro to Java programming(Udacity): a beginer course in Java, help you to build the OOP concept, highly recommened


b. Software Construction in Java(edx): not only cover the Java language, but also the concept of the software engineering, such as version control(git), unit test; really good course, highly recommedned for people who has former programming experience!

(3)HTML/CSS/Javascript:  


(4)android:

a. android basic: user interface(Udacity):  It's a great course, which teachs the XML, which constitute the layout of android

b. android basic:user input(Udacity): It's also a great course, which teachs you how to make interactive app;
p.s. I only recommend this two, because the learning curve is really deep in the sequel!

(5)version control

a. How to use git and github(Udacity): excellent course in git and github, practice git with the vedio, and after you complete the vedio, you will find that you know how to use git well!

leetcode-10 Regular Expression Matching

題意: 待完成

2017年6月19日 星期一

leetcode-4 Median of Two Sorted Arrays

題意: 有兩個已經排序好的陣列,求其中位數,複雜度要求為O(log(n+m)),其中n,m為陣列長度


解題思路:這題非常難,網路上解法有二分搜索和遞迴兩種


C++ code:待補

2017年5月14日 星期日

c++ STL介紹

在C++這個複雜以及難懂的語言中,STL(standard template library)像是提供的一盞明燈,讓大家在汪洋大海有個指引的方向QQ,這麼強大的武器怎麼能不知道呢XD,就讓我們來一一道來吧!!
STL在C++裡面,屬於一種generic programming 的概念,中文將其譯為泛型程式設計,意思是不管任何的資料型態,我們都能用統一的模板(template)來處理,是不是很強大啊~


template在C++內分為兩種,分別是class template 和 fuction template, STL算是class template,其實STL可以分成幾部分,分別是:


1. container: 容器,也就是class template
2. iterator: 迭代器,用來指向container內的元素
3. algorithm: 演算法,這部用多說了吧XD


STL內部其實有非常多種的container,比如說大家熟知的vector,map,set,multimap,multiset...,令人眼花撩亂,之後且讓我一一道來吧!!!讓我們下期再會


參考資料:
1. C++教學手冊
2. edx