OpenLLM-France/wikimedia huggingface dataset:
# MINC/Tutorials/Programming01
## The MINC version of hello world.

Any introduction to a programming language worth its salt will start with a hello world example. MINC, of course, is not its own programming language; it is a C library. So this tutorial will assume some basic knowledge of C, and will guide the reader through opening and reading MINC volumes and then move on to more advanced topics, discussing some of the peculiarities of the MINC file format along the way.
All code examples will work with the MINC library version 2.x (tested on 2.0.13). There are two other libraries for accessing data in MINC files: the MINC version 1.x library, and volume_io. The vast majority of currently existing code uses either of those two; MINC2 is a new library recently introduced. One important difference is that MINC2 can only read version 2.x files; older files have to be converted using the mincconvert command.
The code will be split up and commented upon in pieces for all these tutorials. The unadulterated source code can be found at the end of each tutorial.
The code compiles in the following way (assuming that the minc-toolkit-v2 is installed in /opt/minc/1.9.15):

### Hello World

So on to the hello world example. Here we open a MINC2 volume and get the value of the first voxel.
The include files - only minc2.h is needed for getting all the minc2 functionality.
The data types: the only non-standard one here is mihandle_t, a struct which will be needed by almost all minc2 functions that need to do something or other on a minc2 volume.
And here is the first minc2 command: miopen_volume, which you guessed it, opens a minc2 volume specified by a C string, an indicator of whether the file should be open for reading or writing (reading in this case), and the address of the mihandle_t struct which, if the operation succeeded, will then hold important information about the volume.
Now we get the first voxel, specified by volume coordinates 0,0,0. We are just looking at three-dimensional volumes here, so we created an unsigned long array of three elements, and assigned them all to be 0. We then call the miget_real_value function, specifying the volume handle to get the voxel from, the location (the unsigned long array), the number of dimensions in the file, and the address of the double to which to assign the voxel value. And then we print it to the terminal.
And that was it - the first and quite simple MINC2 program, really just needing two library calls: opening the volume and getting the voxel.
# MINC/Tutorials/Programming04
## Writing a minc volume to file, with an aside on slice scaling

The code in this tutorial reads a MINC file, adds 1 to every voxel, and then writes the modified volume back to file.
Two notes before getting to the code: (1) this will overwrite the file passed as the first argument, so be careful if you actually try the code, and (2) this is a slow way of accomplishing the task - see the next tutorial for a much more sensible way of accomplishing the same goal.
On to the code:
Nothing new up to this point - the variables are declared, the volume is read (though note the second argument to miopen_volume - it now allows for both reading and writing of this volume).
Here the first new minc function crops up: miget_slice_scaling_flag. It performs a very simple operation, asking whether the volume uses slice scaling or global scaling, placing the output into the boolean type miboolean_t.
Scaling is one of the key concepts in MINC, and is introduced here: MINC/Tutorials/Tutorials01 (scroll down to the data-types section). Our program needs to know whether slice scaling is being used for the following reason: the range represented in the volume is usually set to follow the actual range of values present in the volume. This means that if we increment all voxels by 1, we have to make sure that the range of values allowed in the volume is updated as well. As you will see below, updating the range is different depending on whether the scaling is set for the global volume or independently for every slice.
On to more source code:
We obtain the dimension sizes once again ...
... and then proceed to the first part of the scaling issue. If there is no slice scaling, we just need to change the global scaling, which is done by getting the volume maximum using miget_volume_max, and setting it to the previous max+1 using miset_volume_max. There are similar functions for volume_min, which we could reasonably have updated here as well.
This is the core of the code - we loop over all voxels using dimension size information to know when to terminate each loop, get the real value at each voxel, increment it by one, and write it back to the volume using miset_real_value. The first dimension is the slice dimension - so if this volume uses slice scaling we get the slice maximum using miget_slice_max, increment it by one and write it back using miset_slice_max.
Once we've looped over all voxels we close the volume using miclose_volume. And that's it, we're done. The file read in as the first argument should now have all of its values incremented by one. Keep in mind that this was the slow way of doing it - see the next tutorial for a much more sensible version.
# MINC/Tutorials/Programming06
## Hyperslabs part 2

Onto more hyperslabs: we will once again do the same trick of adding one to every voxel. We'll do it slightly differently: this time we will get and set the hyperslab at every slice, using much less memory. And, for even more mincy goodness, we will use slice scaling for the output.
This code is unchanged from the last tutorial.
This time we create the volume before we start messing with the actual data. We also set slice scaling using miset_slice_scaling_flag - note that this has to come before micreate_volume_image. The rest is the same as before.
The loop over the data has become more complicated. We now allocate data for a hyperslab big enough to hold one slice, and we reuse the same array for every slice. We then get the hyperslab for every slice, do the same manipulation of the voxels while keeping track of slice specific min and max, and set the slice range. Then we put the modified hyperslab into the new volume, and move on to the next slice.
And we finish up in the same way as before.
# MINC/Tutorials/Programming02
## The two MINC coordinate systems.

MINC has two coordinate systems: a voxel and a world coordinate system. Voxel coordinates are like arrays, with the origin fixed in one corner of the image and incrementing to the length - 1 of that dimension. World coordinates, on the other hand, reflect the position in real world units of each voxel. Within a particular space, such as Talairach space, each particular coordinate thus has a meaning and is often shared across volumes.
The previous example just obtained a voxel using voxel coordinates - below is the same code modified to obtain a voxel at the origin of the world coordinate system.
So far, so good - this is almost the same code as in the first example with the addition of some extra variables.
This is where the actual conversion happens, taken care of by the miconvert_world_to_voxel function. There are three arguments: the volume struct (initialized by miopen_volume), an array of doubles containing the world coordinates that are to be converted (initialized to be zeros across the board in the line above), and an array of doubles which will hold the corresponding voxel coordinates.
The rest of the code should once again seem fairly familiar. There is one slightly awkward cast in there, as miconvert_world_to_voxel assigns the converted voxel coordinates to an array of doubles, but miget_real_value needs an array of unsigned longs. We could do some real interpolation, but we'll be lazy and just cast the double back to the unsigned long.
# MINC/Tutorials/Programming05
## Working with hyperslabs

The previous tutorial stepped through every voxel of a volume, added 1 to it, and wrote the output back to the same volume. Here we will improve on that example: the output will be written to a new volume, and we will use hyperslabs for the data processing.
A hyperslab is a central concept in minc. It allows you to pull an arbitrary (but contiguous) chunk of data out of a volume, do something to it, and write it back to the volume. This is a lot faster than individually getting each voxel; it does, however, require more memory.
So on to the example: this code takes a volume, creates a copy of it the same in every way except for adding 1 to each voxel. The new volume will also always use global scaling, regardless of whether the input had slice scaling or not.
So far, so good - none of this code should be new to you. Do note the creation of two new variables for the new volume and new dimensions.
Here we allocate memory for the dimensions of the new volume, and copy the dimension definitions from the old volume.
The memory for the hyperslab is allocated and the hyperslab obtained - in this case the hyperslab is the entire volume. The key function is miget_real_value_hyperslab, which takes five arguments: the minc volume handle, the type you want the data to be in, an array of starts (all zeroes in this case), an array of counts( the volume sizes), and the address of where to write the data.
And now we loop over every voxel in the hyperslab (note how it is dealt with as a one-dimensional array), making sure to keep the modified image min and max.
We then create the actual volume using micreate_volume. It takes seven arguments: the filename, the number of dimensions, an array of the actual dimensions (created through the copy operation above), the data type (set to unsigned byte here), the data class, special volume properties (set to NULL here), and the address of the volume handle.
Now we make sure that the data is created inside the minc volume handle using micreate_volume_image.
We then set the valid range - from 0 to 255 since this is unsigned byte data - and the volume range, which was determined by keeping track of the min and max when looping over voxels. The hyperslab is the placed back into the volume using miset_real_value_hyperslab, which takes the exact same arguments as miget_real_value_hyperslab.
And finally we close the volumes, free the allocated memory, and exit.
# MINC/Tutorials/PythonSliceLoop
## A slice loop example using pyminc

When you open a volume in pyminc, none of the data is read until you access the .data variable. This means that you can open lots of volumes at the same time, and then selectively get a hyperslab out in order to conserve memory. The example below reads a bunch of volumes to find the mode (most common voxel) at every point - a simplistic voxel voting scheme for segmentation. A few comments are in the text, more explanation follows:
The key steps in this slice loop is to create an array of all the MINC volume handles, an an array which holds one slice for all volumes, and then to loop over all slices. At every slice the array is refilled with the current slice from each volume, the stat (mode in this case) is computed, and the results inserted into the output volumes.
# MINC/Tutorials/Programming03
## A fully functional and useful example

There are two programs that can be found inside the conglomerate package: print_volume_value and print_world_value. To use them you specify a minc volume and xyz coordinates in either voxel (volume) or world space, and it returns the real value at that location. Here we will combine that functionality into a single minc2 program.
The code is presented in its entirety below, with commentary at the end of this page. The usage is the following:
Where v or w specify whether world or voxel coordinates are specified inside c1 c2 c3.
Most of this code you've seen in the two previous examples. There are a few additional minc library calls - the first is miconvert_voxel_to_world, which does the reverse of miconvert_world_to_voxel. There are also two functions that deal with dimensions. The first, miget_volume_dimensions, places the dimensions associated with the specified minc volume into a midimhandle_t variable. There are several arguments to this function; for the moment it is sufficient to note that the defaults used above will be fine for most cases (and the details will be discussed in a later tutorial). The next function is crucial - miget_dimension_sizes returns the number of elements in each dimension. This is crucial information for looping over voxels as will be illustrated later.
As stated above this code reproduces functionality that exists in print_volume_value and print_world_value. It does, however, illustrate one advantage of minc2 over volume_io (the older library used by those two programs): it is much faster, by as much as an order of magnitude for this example.
# MINC/Tutorials/SourceInstall/Additional requirements

Ubuntu
In a new installation of Ubuntu, these packages could be missing and should be installed using apt-get or synaptic:
* zlib-1g-dev
* libnetpbm9-dev
* libxmu-dev
* libtext-format-perl
* csh
also, latex tools might be necessary to build the documentation.
Graphical interface
These are required only if installing Display and/or register:
* opengl (libGL)
* glut (libglut)
all -dev packages.
Except for Nvidia-based video cards, which have their own libraries installed with the drivers.
# Muggles' Guide to Harry Potter/Characters/Tiberius Ogden
## Overview

Tiberius Ogden is only ever mentioned in passing, but from context we can guess that he is an older wizard who holds a position within the Ministry of Magic, specifically a wizard seated on the Wizengamot.

## Role in the Books
### Order of the Phoenix

Tiberius Ogden is mentioned early on as one of the elder members of the Wizengamot who resigned in protest due to the appointment of Dolores Umbridge at Hogwarts. Along with Griselda Marchbanks he believed that Umbridge's appointment was just another way to spy on and attempt to discredit Albus Dumbledore.
He is later mentioned in passing by Professor Tofty, who says he's heard from him (his “dear friend”) that Harry can produce a Patronus.

## Strengths

Though we do not meet him directly, it is clear that Tiberius is a fair person and is brave enough to publicly declare his faith in Dumbledore and shame the Minister of Magic himself.

## Relationships with Other Characters

Ogden appears to be close friends with both Tofty and Professor Marchbanks. He also seems to be a supporter of Albus Dumbledore.
He may be related to Bob Ogden who was introduced in Harry Potter and the Half-Blood Prince, this however has not been confirmed.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Muggles' Guide to Harry Potter/Characters/Tobias Snape
## Overview

Tobias Snape was a Muggle man who married pure-blood witch Eileen Prince. He is the father of Severus Snape, and in general seems to be rather abusive and unpleasant.

## Role in the Books
### Order of the Phoenix

We first see Tobias briefly during Harry's occlumency lessons with Snape. We get a brief look into some of Severus's memories, one of which we see a man shouting at a frightened looking woman while young Severus cries in the corner of the room. Though we don't learn their names, it is implied that these are Snape's parents.

### Half-Blood Prince

At the end of the book we learn his name for the first time when Hermione shows Harry and Ron some old Daily Prophet articles talking about his marriage to Eileen Prince, and later the birth of their son Severus Snape.

### Deathly Hallows

We hear a bit more about Tobias in Severus's memories. In one we see Severus telling Lily offhandedly that his father doesn't like magic, or anything, very much.

## Relationships with Other Characters

Tobias seemed to be abusive towards his wife and possibly his son as well. It is implied that Severus dislikes his father as evidenced by his comments to Lily Evans.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.

## Greater Picture

Most of what we see or hear about shows Tobias as abusive and disliking magic.
Tobias also provides us with another similarity between Severus and Lord Voldemort. Of course, both are half-blood wizards born to a Muggle father and a pure-blood mother. Both Tobias and Tom Riddle Sr. were shown to have disliked magic and mistreated their wives (though in different ways). Both fathers seem to have been the primary sources for their sons' hatred of Muggles.
# Muggles' Guide to Harry Potter/Characters/Thorfinn Rowle
## Overview

Thorfinn Rowle is a large, blond man. He is a Death Eater.

## Role in the Books
### Half-Blood Prince

When Harry follows Severus Snape, Draco Malfoy, Amycus and Alecto Carrow, and Fenrir Greyback down from the Astronomy Tower after the death of Albus Dumbledore, he finds a large, blond Death Eater in the hallway firing off curses indiscriminately. It seems that one of his curses was the cause of one of the two Death Eater casualties; he had tried to curse Remus Lupin and missed. At the word from Snape, he breaks off the fight and runs, along with the others; apparently he follows Snape, who is using various short cuts, because he is ahead of Harry when they reach the front door of the school, while the Carrows are behind Harry. As he escapes, the large blond Death Eater casts multiple curses at Hagrid, but they are apparently ineffective, he then resorts to setting Hagrid's hut on fire. He was then ordered by Snape to flee before the Ministry wizards arrived.

### Deathly Hallows

When the two Death Eaters attack Ron and Hermione in the cafe on the Tottenham Court Road, Harry recalls that the "large blond" Death Eater was one of the ones at Hogwarts, and recognizes the other is Antonin Dolohov. Ron tells Harry that he thinks the large one's name is Thorfinn Rowle.
After the Trio have returned to Grimmauld Place, Harry has an episode where he sees into Lord Voldemort's mind. Thorfinn Rowle is being tortured for having let Ron and Hermione escape. Harry is sickened to find that Voldemort is ordering Draco Malfoy to do the actual torturing.
Rowle is one of the Death Eaters gathered around Voldemort in the clearing in the forest when Harry goes to meet Voldemort. When Hagrid tells Harry to run for it, Rowle is the Death Eater who silences him.

## Strengths

Rowle appears to be a reasonably powerful wizard. When Death Eaters invaded Hogwarts at the end of Harry Potter and the Half-Blood Prince, he was shown causing fairly major damage, though admittedly it was rather random, often aimed at building features rather than defending wizards. He is described as being the "huge, blonde death eater" indicating that his well built and muscular. He has the Dark Mark on his inner forearm and is around 6ft3 tall.

## Weaknesses

He is known to be careless, firing curses all over the place without consideration. This makes him dangerous to even his fellow Death Eaters.

## Analysis

Out of the many Death Eaters we encounter during the course of the series, Rowle appears to be among the most dangerous. He has very little consideration for where his curses are going, firing them indiscriminately during battle; even being in his vicinity must be risky.
He also kills one of his own side - fellow Death Eater Gibbon - by mistake. He appears to show very little remorse for this, if indeed he was aware.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Muggles' Guide to Harry Potter/Characters/Trevor
## Overview

Trevor is Neville's pet toad, who is forever getting lost.

## Role in the Books
### Philosopher's Stone

When we first see Neville, he is standing on the platform talking to an older witch, apparently his grandmother. It seems that he has lost Trevor.
We are introduced to Trevor by Neville, who looks in to Harry and Ron's compartment on the Hogwarts Express to ask if they have seen him. Some time later, Hermione stops by on the same errand; apparently she has chosen to help Neville in his search. Trevor remains lost until the students are leaving the boats on the shore of the lake under Hogwarts; Hagrid apparently then finds him and asks whose toad this is.
Professor Flitwick had demonstrated making things fly by sending Neville's toad soaring about the classroom.
Neville is apparently trying to catch Trevor again when he overhears Harry, Ron, and Hermione planning how to get through the trap door. Dropping Trevor, he prepares, unsuccessfully, to fight them.

### Order of the Phoenix

When we meet Neville in the Hogwarts Express, he is dragging his trunk and holding on to a struggling Trevor. He continues to hold Trevor throughout the early part of the trip, dumping him in Harry's lap as he prepares to demonstrate the defensive mechanism of his prized Mimbulus Mimbletonia. Harry, holding on to Trevor, is drenched with Stinksap.
We see Trevor again as they leave the train; Neville carefully stores him in an inside pocket.

### Deathly Hallows
## Strengths

Although he is often getting lost, Trevor always manages to get found again. It seems he has some ability to transport himself, as he manages to reach the far shore of the lake before Neville himself does.

## Analysis

Trevor seems to be present only to give Neville something else to misplace and worry about. He never appears to have any power save that of getting lost, and later appearing where he would have been if Neville had been able to retain him — for instance, he is lost on the Hogwarts Express, in book 1, but then appears near the castle as the first-years are getting out of the boats.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Muggles' Guide to Harry Potter/Characters/Urquhart
## Overview

Urquhart is Slytherin's new Quidditch captain in Harry's sixth year.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Muggles' Guide to Harry Potter/Characters/Vaisey
## Overview

Vaisey is a Chaser on the Slytherin Quidditch team in Harry's sixth year.

## Role in the Books
### Half-Blood Prince

Just before the Quidditch match between Slytherin and Gryffindor, Ginny Weasley tells Harry that Vaisey took a Bludger to the head during the previous day's practice, and is too sick to play. This greatly heartens Ron, as Vaisey is evidently Slytherin's top scorer.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Muggles' Guide to Harry Potter/Characters/Tom Riddle Sr.
## Overview

Tom Riddle is a Muggle and heir to the Manor House in the town of Little Hangleton.

## Role in the Books
### Chamber of Secrets

We find that Voldemort's real name is Tom Marvolo Riddle, and that he hates the fact that he is the son of the Muggle Tom Riddle.

### Goblet of Fire

In a flashback, we learn that Tom Riddle and his entire family had died mysteriously some fifty years earlier. The gardener, Frank Bryce, had been suspected at the time, but had been released. The old Riddle Manor had been not much tenanted since. We learn that now Voldemort, with his assistant Peter Pettigrew (Wormtail), is living in the manor house again.
Some of Tom Riddle's bone is extracted from his gravesite in Little Hangleton as part of the spell and potion that re-embody Lord Voldemort.

### Half-Blood Prince

In memories which Albus Dumbledore shows Harry, we discover that some sixty years before, Merope Gaunt had been infatuated with Tom Riddle. When her brother and father were imprisoned in Azkaban, she apparently used a love potion to ensnare Tom Riddle, take him to London, and convince him to marry her. She then somehow lost or relinquished control over him, upon which he left her, returning to Little Hangleton. Merope died bearing his son, whom she left at an orphanage, naming him Tom Marvolo Riddle for his father and grandfather.

## Relationships with Other Characters

Father of Tom Marvolo Riddle. Merope Falls in love with him and together they are Tom Jr.'s parents.

## Questions

Study questions are meant to be left for each student to answer; please don't answer them here.
# Pinyin/Housework

Search Pinyin housework
# Pinyin/Huge

See also
# Pinyin/Huge stone

See also