OpenLLM-France/wikimedia huggingface dataset:
# Advanced EMMA Image Manipulation

This tutorial covers advanced image manipulation using MATLAB and the EMMA toolkit. It assumes that the reader already has a familiarity with EMMA and basic image manipulation.

### Creating and Using a Mask

Let's start by assuming that we have loaded 21 frames from one slice of a dynamic PET study into a variable called PET. We want to create a mask that contains 1's where the brain is, and 0's everywhere else. If this is an oxygen study, one simple approach is to integrate the image over time, and then choose values for mask pixels by using a threshold. Assuming a variable called ftimes that contains the mid-frame times of the frames:
is the integrated image. We now wish to choose pixels for the mask. MATLAB is able to perform boolean operations on a vector of values, so this is very easy:
In this case, pixels in mask will be set to 1 if the value of the integrated image is greater than the mean of the entire image times some threshold. To create a mask that masks out everything except brain, we would generally choose a threshold of one (all pixels in the integrated image that have a value greater than the mean of the integrated image are chosen):
This produces an image that looks like:
File:Emma2mask.gif
This mask can be easily applied to the original images by simply multiplying the two together:
This will produce a masked version of frame 17, which looks like:
File:Emma2masked.gif

### Averaging a Set of Images

When performing a PET study, a set of data from several subjects is usually collected. Once all of the data is collected, the data from the various separate studies must be averaged together. MATLAB allows math to be performed on images in a very straight forward way. Assuming that we have a set of images stored in variables P1, P2, P3, P4, and that we wish to average these four images, the result is simply:

### Producing Time Activity Curves

Time activity curves are very simple to produce using MATLAB. EMMA provides a function called maketac that given the x and y coordinates of a point, and a set of dynamic PET images, will return a time-activity curve based on a 5 pixel square region of interest (ROI). The methods used in the maketac function can be extended to any size/shape ROI. One example of its use is:
The first line displays the integrated image (calculated previously), the second line prompts the user to click on a point in the image (returning the x and y coordinates of the point), the third line creates the time activity curve and saves it in the variable tac, and the last two lines create a plot of the curve (remember that ftimes contains the mid-frame times, retrieved previously). The resulting plot might look something like this:
File:Emma2tac.gif
# MINC/Tools/emma/emma-roi
## Region of Interest (ROI) Analysis Using MATLAB and EMMA

There are existing packages at the MNI for performing ROI analysis, the foremost of which is roi. However, none of these was designed to work explicitly with MATLAB. Since much analysis is currently being done within the MATLAB environment, a ROI package was developed for MATLAB. The package consists of the following MATLAB functions:
* drawboxroi - Draw a simple box ROI on a figure
* drawpolyroi - Draw a general polygonal ROI on a figure
* drawroi - Draws a given ROI on a given figure
* getroi - Get the normalized vertices of a ROI
* makeroimask - Create a mask from a set of ROIs
* transferroi - Copies ROIs from one figure to another
Use of this package is reasonably straight forward. The following short example demonstrates the use of the ROI package for creating a mask to be applied to PET images:
In this example, we load a PET image and an MRI image (which have been registered to each other and resampled so that slice 8 of one corresponds to slice 8 of the other). The MRI slice is displayed, and the drawpolyroi function is called to create an ROI. Once the ROI has been drawn, a 128x128 mask is created, and this is applied to the PET image.
This same technique could be applied for the creation of any number of ROIs on a single slice, and then all of the ROIs could be included in a single mask.
# RCBF Analysis using MATLAB and EMMA

Two-compartment regional cerebral blood flow (RCBF) analysis is very easy to perform using MATLAB and the EMMA toolkit. The rcbfanalysis function allows the specification of the MINC file containing the study to analyze, the name of the MINC file to write the K1 images to, the name of the MINC file to write the V0 image to, and the slices to analyze. Warning: if the K1 file or V0 file already exist, they will be overwritten, destroying any data that they may contain. Therefore, to analyze the dynamic PET data stored in the file /local/matlab/toolbox/emma/examples/yates_19445.mnc, and produce both a K1 image and a V0 image for all 15 slices, we would specify:
The resulting files yates_K1.mnc and yates_V0.mnc will be written in the current directory.
If only a K1 image is desired, we can specify an empty matrix for the name of the V0 file:
The same is true if we only want a V0 image file produced:

### Layers of the Onion

The rcbfanalysis function performs its analysis by calling the EMMA rcbf2 function. This function may also be called by the user, if it is more convenient to get the K1, k2, or V0 images without having to produce MINC files for them. The rcbf2 function is very easy to use. Simply specify the name of the MINC file containing the study to analyze, and the slice numbers to analyze. The function returns the K1, k2, and V0 images, as well as the blood delay correction for each slice analyzed:
This call to rcbf2 will analyze slice eight of the yates_19445 study, producing K1, k2, and V0 images, as well as the calculated delta for this slice. The images returned are stored as EMMA standard vector images, and may be manipulated in the same way as any EMMA image.

### Study Preparation

One final point to consider. The study being analyzed must contain the blood data as well as the PET images. There are several programs that are capable of doing this, the most important of which is scxtominc, which creates MINC files from the Scanditronix format files produced by the PET scanner. This program has a -bloodfile option which allows the specification of a blood file whose data should be included in the final MINC file. The blood file specified must be in BNC (Blood netCDF) format, and is produced by the blood lab computer and written to $PC_BLOOD. A BNC file may also be created from a CNT file using the bloodtonc program. Assuming that we wish to create a MINC file from the raw images and the BNC file, we might specify a command line to scxtominc that looks like:
This creates a MINC file called soos_34157.mnc from the raw images and the BNC file.
It is also possible to include blood data in an existing MINC file using the includeblood program. Simply specify the name of the MINC file, and the name of the BNC file to include within it.
# Mandarin Chinese Grammar for Pimsleur Students/Lessons/Lesson 25

商店 shāng diàn
开门 kāi mén
关门 guān mén
为 wèi
因为 yīn wèi
# Mandarin Chinese Grammar for Pimsleur Students/Negation

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Negation
### Negation words

| 不 | bù | not |
| 没 | méi | not (only referring to 有 / yŏu / to have) |

### Syntax

| 他不是中国人 ◦ | tā bù shì Zhōnguó rén. | He is not Chinese. |
| 他们不会说英文 ◦ | tāmen bù huì shuō yīngwén. | They cannot speak English. |
| 八点钟不好 ◦ | bā diăn zhōng bù hăo. | 8 o'clock is not okay. |
| 九点钟不行 ◦ | jiŭ diăn zhōng bù xíng. | 9 o'clock is impossible. |
| 我说得不好 ◦ | wŏ shuō de bù hăo. | I don't speak well. |
| 不是现在 ◦ | bù shì xiàn zài. | Not now. |
| 我没有茶 ◦ | wŏ méi yŏu chá. | I don't have any tea. |
# Mandarin Chinese Grammar for Pimsleur Students/Non-adjectival stative verbs

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Non-adjectival stative verbs
### Linking verbs

The most common use of 是 is the copula, which connects nouns, noun phrases, and/or pronouns. 是 functions as a verb, and like all other Chinese verbs, is not conjugated for person, number, or tense.
| 是 | shì | to be |
| 她是中国人 ◦ | tā shì Zhōngguó rén. | She is Chinese. |
| 是在北京 ◦ | shì zài Běijīng. | It's in Beijing. |
| 不是在北京 ◦ | bù shì zài Běijīng. | It's not in Bejing. |
| 不是现在 ◦ | bù shì xiàn zài | (it is) not now |
| 是八点钟 ◦ | shìbā diăn zhōng | (it is) at eight o'clock |
| 钱是给你的 ◦ | qián shì gěi nĭ de. | The money is for you. |
| 三加三是多少 ? | sān jiā sān shì duōshăo? | How much is three plus three? |
| 哪条是学院路 ? | nă tiáo shì Xuéyuàn lù? | Which one (which road) is College road? |
Another very important verb is 有, which means "to have." To negate any verb, including adjectival stative verbs, the negation particle 不 is placed before the verb. 有 is the only exception; it is negated with 没 instead of 不.
| 有 | yŏu | to have |
| 他有百美金 ◦ | tā yŏu băi měi jīn. | He has 100 dollars. |
| 她没有时间 ◦ | tā méi yŏu shíjiān. | She doesn’t have time. |
| 他家里有六个人 ◦ | tā jiālĭ yŏu liù gè rén. | There are six people in his family. |
At this point it essential to note that 有 (yŏu) and 是 (shì) are not interchangeable, even in negative form.
| Positive | Negative |
| 是 (shì: is) | 不是 (Bùshì: is not) |
| 有 (yŏu: have) | 没有 (Méiyǒu: not have) |
没有 is interchangeable with 没 except in the question word 有没有 ("have-not-have"), which means "do(es) X have," where X is any noun or pronoun.

### Verbs of ability, possibility, and permission
#### Overview

| 会 | huì | can (know how to) |
| 可以 | kěyĭ | can (have the permission/opportunity to) |

#### Syntax

| 我不会说国语 ◦ | wŏ bù huì shuō guó yŭ. | I can not speak Mandarin. |
| 他们可以去美国 ◦ | tāmen kěyĭ qù měiguó. | They can go to America. |
| 你可不可以买一点儿啤酒 ? | nĭ kě bù kěyĭ măi yìdiăn'r píjĭu? | Can you buy some beer? |

### Others

| 明白 | míng bai | to understand |
| 我不明白你说什么 ◦ | wŏ bù míng bai nĭ shuō shénme. | I don't understand what you are saying. |
| 想 | xiăng | to want |
| 我想吃一点儿东西 ◦ | wŏ xiăng chī yìdiăn'r dōngxi. | I would like to eat something. |
| 要 | yào | to want, will (see also: Future tense) |
| 你要不要 ? | nĭ yào bù yào? | Do you want? |
| 知道 | zhī dào | to know |
| 他不知道 ◦ | tā bù zhī dào. | He doesn't know. |
| 你知道长安街在哪儿吗 ? | nĭ zhī dào Cháng Ān jiē zài nǎr ma? | Do you know where Long Peace Street is located? |
# Mandarin Chinese Grammar for Pimsleur Students/Lessons
## Lesson by Lesson

Lesson 7
Lesson 25
# Mandarin Chinese Grammar for Pimsleur Students/Numbers

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Numbers
### Number names

| 一 | yī | 1 |
| 二/两 | èr/liăng | 2 |
| 三 | sān | 3 |
| 四 | sì | 4 |
| 五 | wŭ | 5 |
| 六 | liù | 6 |
| 七 | qī | 7 |
| 八 | bā | 8 |
| 九 | jiŭ | 9 |
| 十 | shí | 10 |
| 十一 | shí yī | 11 |
| 二十 | èr shí | 20 |
| 二十一 | èr shí yī | 21 |
| 一百 | yī băi | 100 |
| 一千 | yī qiān | 1,000 |
| 两千 | liăng qiān | 2,000 |

### Measure words (classifiers)

| 个 | gè | general classifier | persons, hours, flights, etc. |
| 杯 | bēi | glass, cup | beverages such as water, tea, beer etc. |
| 顿 | dùn | meal | meals |
| 家 | jiā | house | businesses, families, etc. |
| 块 | kuài | unit | currencies such as renmingbi, dollar, etc. |
| 条 | tiáo | long thin things | ribbons, rivers, roads, trousers, etc. |

### Time

| 一点钟 | yī diăn zhōng | 1 o'clock |
| 两点钟 | liăng diăn zhōng | 2 o'clock |
| 三点钟 | sān diăn zhōng | 3 o'clock |

### Money

Currencies:
| 港币 | găngbì | Hong Kong dollar |
| 美金 | měi jīn | U. S. dollar |
| 人民币 | rénmínbì | Chinese currency (Renminbi, RMB) |
Examples:
| 一块人民币 | yī kuài rénmíngbì | 1 (unit) RMB |
| 两块美金 | liăng kuài měi jīn | 2 (units) U. S. dollars |
| 你有多少人民币 ? | nĭ yŏu duōshăo rénmíngbì? | How many RMB do you have? |
| 我有一点儿人民币 ◦ | wŏ yŏu yìdiăn'r rénmíngbì. | I have some RMB. |

### Math

| 加 | jiā | plus |
Examples:
| 三加三是多少 ? | sān jiā sān shì duōshăo? | How much is 3 plus 3? |
# Mandarin Chinese Grammar for Pimsleur Students/Future tense

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Future tense

The future tense is generally indicated by the auxiliary verb 要 (yào). 会 (huì) can also be used in the same way. The difference in meaning is slight; 要 conveys more of a "plan to" or "going to" meaning, while 会 means a default "will," indicating that the speaker is rather confident that the following action will happen, at least when compared to 要.
| 要 | yào | will, want |
| 我们要坐飞机去 ◦ | wŏmen yào zuò fēijī qù. | We will travel by airplane. |
| 我要现在吃午饭 ◦ | wŏ yào xiàn zài chī wŭfàn. | I am going to have lunch now. |
| 要几个小时 ? | yào jĭ ge xiăoshí? | How many hours is it going to be? |
| 我会迟到。 | wŏ huì chí dào. | I will be late. |
# Mandarin Chinese Grammar for Pimsleur Students/Nouns

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Nouns
### Examples
#### Countable
##### Nouns that go with the measure word 个 / ge ("unit"/"individual")

| 班机 | bān jī | flight, airplane |
| 儿子 | érzĭ | son |
| 飞机 | fēijī | airplane |
| 飞机场 | fēijīchăng | airport |
| 女儿 | nǚér | daughter |
| 人 | rén | person |
| 太太 | tài tài | wife |
| 先生 | xiānshēng | husband |
| 小孩儿 | xiăo hái'er | child |
| 小时 | xiăoshí | hour |

##### Nouns that go with the measure word 条 / tiáo ("string")

| 街 | jiē | street |
| 路 | lù | road |
| 蛇 | shé | snake |

##### Nouns that go with the measure word 家 / jiā ("house"/"family")

| 饭店 | fàn diàn | restaurant |
| 酒店 | jiŭ diàn | hotel |

##### Nouns that don't require another measure word

| 家里 | jiā lĭ | home, family |
| 家人 | jiā rén | family, household |
| 洗手间 | xĭ shŏu jiān | bathroom |

#### Not countable

| 茶 | chá | tea |
| 啤酒 | píjĭu | beer |
| 钱 | qián | money |
| 水 | shuĭ | water |

#### Others

| 东西 | dōngxi | thing, something |
| 晚饭 | wănfàn | dinner |
| 午饭 | wŭfàn | lunch |

### Notes

Measure words, or classifiers, are placed before nouns and any modifying adjectives. They are generally based on shape, size, amount, animacy, and/or function. Contrary to what some might believe, which classifier is used with a noun is often not strictly one classifier. As such, one should not liken classifiers to the gendered articles found in many languages such as German or Spanish.
When you do not know which classifier to use, guess 个, as native speakers often default to 个 in daily conversation unless the classifier is obvious.
Generally, people and intangible nouns (like ideas, processes, etc.) take 个. To signal respect to a person's job, that role (e.g. teacher) may take the classifier 位 (wei4).
Animals take 只 (zhi1) by default, but for large animals like cattle (牛) and sheep (羊), 头 ("head") is used. For dogs, either 条 or 只 is used depending on the speaker and region, and if the dog seems long in shape.
# Mandarin Chinese Grammar for Pimsleur Students/Past tense
## Past tense
### Particles/characters used

There are some specific particles, characters or combination of characters used to make sentence past tense:
* 了 - le
* 过 - gùo
* 是 ... 的 - shì ... de

### 了 le

了 is used either after the verb or after the sentence to make it past tense. According to Pimsleur tapes, 了 added directly after the verb is for telling a list of things you did in the past. For a simple statement that you did something, just add 了 after the sentence.
* 我吃午饭了
* 昨天我吃了早饭，吃了午饭，然后我吃晚饭了

### 过 gùo

过 is used to tell that you've had an experience and is added after the verb.
* 我去过北京
* 我来过这儿

### 是 ... 的 shì ... de

This is used to tell or ask something detailed about the past. 是 is added after the subject and 的 at the end of the sentence.
* 你是什么时候去北京的？
* 我是跟我的朋友一起看电影的
# Mandarin Chinese Grammar for Pimsleur Students/Phrases

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Phrases

| 罢 | … bà | let's say, … |
| 不客气 | búkèqì | you’re welcome, don’t mention it |
| 对不起 | duìbùqĭ | I’m sorry, pardon me |
| 麻烦你 | máfán nĭ, … | please, … (lit.: trouble you) |
| 那 | nà | there you go, there you are (handing something to a person) |
| 那么 | nàme | in that case, … |
| 你好 | nĭ hăo | hello |
| 你们好 | nĭmen hăo | hello (to more than 1 person) |
| 你好吗 ? | nĭ hăo ma? | how are you? (not a greeting) |
| 我啊 | wŏ à, … | as for me, … |
| 谢谢 | xiè xie | thanks |
| 谢谢你 | xiè xie nĭ | thank you |
| 再见 | zàijiàn | good bye |
| 早好 | zǎo hăo | good morning |
# Mandarin Chinese Grammar for Pimsleur Students/Prepositions

* Mandarin Chinese Grammar for Pimsleur Students
* NOUNS - Pronouns - Nouns - Proper nouns
* VERBS - Activity verbs - Adjectival stative verbs - Non-adjectival stative verbs - Yes/No answers - Past tense - Future tense
* OTHERS - Negation - Questions - Adverbs - Conjunctions - Prepositions - Numbers - Phrases

## Prepositions
### General

| 跟 | gēn | with |
| 我想跟你一起吃晚饭 ◦ | wŏ xiăng gēn nĭ yìqĭ chī wǎnfàn. | I would like to have dinner with you. |
| 儿子跟我们在这儿 ◦ | érzĭ gēn wŏmen zài zhè'er. | The son is here with us. |

### Location

| 在 | zài | (located) at, in |
| 在饭店 | zài fàn diàn | at the restaurant |
| 我的朋友在我那儿 ◦ | wŏ de péngyou zài wŏ nà'r. | My friend is at my place. |
| 我的太太在香港 ◦ | wŏ de tài tài zài Xiānggǎng. | My wife is in Hong Kong. |
| 我们住在美国 ◦ | wŏmen zhù zài měiguó. | We live in America. |
| 学院路在哪儿 ? | Xuéyuàn lù zài nă'r? | Where is College Road located? |
| 是不是在这儿 ? | shì bù shì zài zhè'r? | Is it located here? |
| 我不想在那儿吃 ◦ | wŏ bù xiăng zài nà'r chī. | I would not like to eat over there. |
| 在那儿不太贵 ◦ | zài nà'r bù tài guì. | Over there it's not too expensive. |
| 她跟你的先生在一起 ◦ | tā gēn nĭ de xiānshēng zài yìqĭ. | She is with your husband (literally: She with your husband are located together). |
# New Zealand History/The Colonial Government

‹ Back to Railways Introduced to New Zealand

## The Colonial Government

After New Zealand was annexed by Britain, it was initially set up as a dependency of New South Wales. However, by 1841, New Zealand was made a colony in its own right. As a colony, it inherited political practices and institutions of government from the United Kingdom.
The United Kingdom Government started the first New Zealand Government by appointing governors, being advised by appointed executive and legislative councils.
In 1852, the British Parliament passed the New Zealand Constitution Act, which provided for the elected House of Representatives and Legislative Council. The General Assembly (the House and Council combined) first met in 1854.
New Zealand was effectively self-governing in all domestic matters except 'native policy' by 1856. Control over native policy was passed to the Colonial Government in the mid-1860s.
The first capital of the country was Russell, located in the Bay of Islands, declared by Governor Hobson after New Zealand was formally annexed. In September 1840, Hobson changed the capital to the shores of the Waitematā Harbour where Auckland was founded. The seat of Government was centralised in Wellington by 1865.
Provincial Governments in New Zealand
From 1841 until 1876, provinces had their own provincial governments. Originally, there were only three provinces, set up by the Royal Charter:
* New Ulster (North Island north of Patea River)
* New Munster (North Island south of Patea River, plus the South Island)
* New Leinster (Stewart Island)
In 1846, the provinces were reformed. The New Leinster province was removed, and the two remaining provinces were enlarged and separated from the Colonial Government. The reformed provinces were:
* New Ulster (All of North Island)
* New Munster (The South Island plus Stewart Island)
The provinces were reformed yet again by the New Zealand Constitution Act 1852. In this constitution, the old provinces of New Ulster and New Munster were abolished and six new provinces were set up:
* Auckland
* New Plymouth
* Wellington
* Nelson
* Canterbury
* Otago
Each province had its own legislature that elected its own Speaker and Superintendent. Any male 21 years or older that owned freehold property worth £50 a year could vote. Elections were held every four years.
Four new provinces were introduced between November 1858 and December 1873. Hawkes Bay broke away from Wellington, Marlborough from Nelson, Westland from Canterbury, and Southland from Otago.
Not long after they had begun, provincial governments were a matter for political debate in the General Assembly. Eventually, under the premiership of Harry Atkinson, the Colonial Government passed the Abolition of Provinces Act 1876, which wiped out the provincial governments, replacing them with regions. Provinces finally ceased to exist on the 1st of January 1877.
Forward to The Dawn of the Twentieth Century ›
# New Zealand History/Railways

‹ Back to The New Zealand Wars

## Railways Introduced to New Zealand

Railways were initially constructed by provincial governments looking for a mode of efficient transportation.
The first railway in New Zealand was constructed by the Canterbury Provincial Government in 1863. It was built to a broad gauge of 5 feet 3 inches (1600 mm), to suit rolling stock imported from Victoria, Australia. Its primary purpose was to service ships docked at the Ferrymead wharf.
On the 5th of February 1867, the Southland Provincial Government opened a branch railway from Invercargill to Bluff. This railway was built to the international standard gauge of 4 ft 8½ inches (1,435 mm). At this stage, the Central Government set the national gauge at 3 ft 6 in (1,067 mm).
A narrow-gauge line was opened on 1 January 1873, in the Otago Province, and Auckland's first railway, between Auckland and Onehunga, opened in 1873.
After the abolition of provincial governments in 1876, the Central Government took over the building of railways in New Zealand.
Forward to The Colonial Government ›