<Volume Image의 dimension을 변경할 필요가 있을 때>original article :
http://www.cns.nyu.edu/~jonas/doc/SurfRelax-HOWTO-4.html
Changing image orientation
It is very important that the input image is in the correct orientation. To check this, once the file is in Analyze format, inspect the image in VolumeViewer. In horizontal view, the front of the brain should be upward, the back downward, true left should be rightward and true right leftward (radiological convention). Sagittal view should display the front of the head leftward, back rightward, top upward, and bottom downward. Coronal view similary for up and down, and again in radiological convention (left shown on right, right shown on left). If your data does not look ok, you need to reorder/reorient the image. To do this, use the program imageconv with the -swapdim option. Suppose your image is in the correct orientation, but flipped left-right. The syntax for flipping would be:
$> imageconv -swapdim "-1 2 3" input.img output.img
The argument to swapdim is a vector that defines how the dimensions (axes) of the image should be rearranged, relative to the original; 1 means the fastest changing dimension, 2, the next fastest etc. A negative number means that dimension should be reversed. E.g. if your image is oriented such that x and z are exchanged (i.e. in VolumeViewer you see axial slices in Sagittal view, and sagittal slices in Horizontal view), then you would write
$> imageconv -swapdim "3 2 1" input.img output.img
meaning swap dimensions 1 (=x) and 3 (=z).
Once your data is in the correct format and orientation, you're ready to start. The following tutorial uses the sample data set provided in the $TFIDIR/examples directory. The sample data set consists of an input MR image (sample.img) and the results of running a full analysis of this brain (surface extraction, inflation, cutting and flattening). By running the tutorial on this data set you can compare your intermediate and final results against the sample data to make sure that you are doing things correctly - if you are, the results should be identical.
To run the tutorial, move into an empty directory and copy the sample input MR image (sample.img and sample.hdr) into this directory. Don't run the tutorial inside the examples directory, as doing so will overwrite the sample data set.
NB. Always run SurfRelax from within the directory where you want the output results. It is also advisable to store the input files in the same directory.
Start by opening the sample image (a T1 weighted MPRAGE, acquired on a Siemens Allegra 3T scanner) in VolumeViewer:
1. mprage 2개를 만든 다음에 averageAnalyze.m 를 이용해서 하나의 mprage파일로 만들어본다.
-이 때 command는 command_Set.m에 적혀있다.
2. 이때 완성된 파일은 average_mprage2regTo1.*가 된다.
3. volumeViewer를 이용해서 노이즈를 한번 본다.
- evalNoise.m을 실행, 2개를 실행하는게 원래 프로그램인데, 처음에는 노이즈 range만 설정하는 것이기 때문에 average한 data만 사용하도록 프로그램을 수정한다.
- 이렇게 해서 noise값을 보면 상당히 높게 나온다. 이것은 brain image가 없는 slice가 포함되어서 그러는 것이므로 이런 slice를 제거할 필요가 있다. 이것은 VolumeViewer에서 3가지 축으로 각각 이미지를 보면서 brain image가 없는 slice번호를 알아낸 다음에 다시 First_evalNoise에서 범위를 설정해준후 Noise값을 얻어 낸다.
- 그러면 그래프가 뜨는데, 거기에 나오는 data에서 노이즈 값이 나오면 그걸로 surfRelax에 넣어서 preprocessing을 한다.
4. surfRelax의 preprocessing을 선택하고, 위에서 구한 노이즈 값을 입력, verbose, wiener filter를 설정.
- evalnoise 프로그램을 이용해서 이전 이미지와 preprocessing한 이미지를 비교해 본다.
- 비교해서 노이즈 level을 비교해본다.
5. extract-> interactive로 가서 preprocessing 이미지 선택, output은 _ni를 붙인다.
6. 요나스 홈페이지 메뉴얼을 보면서 low threshold white matter 를 정해야 한다.
7. volume viewer에서 pp.img를 선택한 후, overlay/new overlay from image를 선택후, overlay min/max를 설정해야 한다.
8. omin을 대충 설정하고 보는데, 이때 Goodies를 이용해 connected component connectivity / 6 connectivity를 선택후 , white matter의 center를 마우스로 눌러서 label connected component를 실행하면 빨간색으로 연결된 부분이 선택된다. 이것은 white matter라고 선택된 부분 중에 연결된 부분을 선택해서 보여주는 것인데, 이 값이 작으면 바깥쪽에 있는 skull이 빨간색으로 선택된다.
따라서 두개골이 빨간색으로 선택되지 않으면서 white matter만 선택하는 omin/ omax를 선택하면 된다.
우선 min을 찾고, 그걸 고정시킨 다음에 max를 잡아본다. min은 낮고, max는 높을 수록 좋다. 대신 가능하면 max값이 외부의 skull을 포함하지 않고, 내부에 구멍이 생기지 않는 정도의 max값을 찾는 것이 좋다.
이렇게 해서 omin/omax를 찾은 후에는 max 값을 찾아야 하는데, 이럴 경우 유용한 것은 원래 이미지에서 make histogram을 이용해서 우측에 나타나는 white matter 분포의 끝 부분 값을 찾아서 그걸로 결정하는 것이 좋다.
9. 이렇게 발견한 omax/omin을 normalize Intensity의 white matter의 low/high값에 넣어준다. 이때 save correction field image를 지정해준다. intermediate file도 save해준다.
<span style="color: #ff0003">이번에 가천의대에서 했던 실험에서 내 brain의 value는 omin=488, omax=740 이었다.</span>
10. normalize intensity를 한 후에는 skull을 없애야 한다. 이때, 모든 값은 default로 둔 다음에 각각의 파일을 지정해주고 실행하면 된다.
- 내 brain같은 경우에는 default값으로 두고 strip skull을 했을 경우에는 skull이 제대로 제거되지 않는 경우가 발생했다. 이것은 inhomogeneity때문에 그런 것인데, 이때는 wrap value를 올려주면 된다. (default값은 40.xx) 적절한 값은 skull과 eye가 제거되는 값이다. trial & error로 찾아야 한다.
- 일단은 60으로 하니 eye부분이 거의 사라졌다. 그렇지만 brain부분도 좀 사라졌다.
11.