-
Notifications
You must be signed in to change notification settings - Fork 5
/
README.txt
98 lines (84 loc) · 6.28 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
This software package titled: DTHB3D_Reg, performs 3D image registration for a pair
of images, either synthetic or medical, which are of the same size. The user should
put the images in the MedicalImages3D folder while running the code.
The code is tested with the MATLAB 2017a version. Some functions use parallelization
to accelerate computation. This is done by using "parfor" loops. Also, we have use
mex functions that are automatically generated from the .m file using the Matlab Coder
toolbox. The compiled .mex files and the original .m files are both provided.
General instructions to run the code:
1. I1 = Moving image and I2 = Fixed image
2. The default number of maximum refinement levels are set as 3. Code will work for
refinement levels from 1 to 4.
3. To run the files, go to the run folder and run the appropriate mainfunction_*.m
files for each of the example listed below.
4. If the compiled .mex files do not work with your Matlab version or achitecture,
the compile_mex.m file in the run/ folder can be run. This function compiles all the
MEX functions using the OpenMP parallel framework, provided that a supported compiler
is installed. If compilation fails, the native Matlab .m files can be used by removing
the "_mex" suffix from the function names.
For different examples, we have used different main files for running with the respective
settings:
1. Sphere to torus image example (Fig. 2 in article)
run file: mainfunction_synthetic_sphere2torus.m function is used to run this example. In this
function the .mat files should be correctly loaded in lines 35 onwards, i.e. sphere_200_255.mat
and torus_200_255.mat files. The image files are in synthetic_images folder. The output
file containing the resulting output of the accuracy, number of control points, etc is
written in output_file_sphere_torus.txt file.
The error tolerance value is set as tol = 1e-04 and the maximum iterations are set
as 50. Users can set it accordingly on lines 30 onwards. The rest of the parameters
are set in the file setparameters_synthetic.m file in the setparameter_files folders.
The function call is on line 20 in the main function file.
To set the parameters, modify the setparameters_synthetic.m function.
2. Sphere to Sun example (Fig. 3 in article):
run file: mainfunction_synthetic_sphere2sun.m function is used to run this example. The
image files are in synthetic_images folder. In this function the .mat files should
be correctly loaded in lines 35 onwards, i.e. Sphere.mat and sun_like.mat files.
User should make sure I1 = Sphere and I2 = sun_like. The output file containing the
resulting output of the accuracy, number of control points, etc is written in output_file_sphere_sun.txt
file. Modify filename as per the example. To set the parameters, modify the setparameters_synthetic.m
function.
3. Brain MRI taken from Brainweb website (Fig. 5 in article)
run file: mainfunction_medical_img.m function is used to run this example. Download
the files from the website http://brainweb.bic.mni.mcgill.ca/brainweb/anatomic_normal_20.html
Save the files in medical_images folder. The output file containing the resulting
output of the accuracy, number of control points, etc is written in output_file_medical_img.txt
file. Modify filename as per the example. To set the parameters, modify the setparameters.m
function.
4. Registration of pre-operative and post-operative MRI (Fig. 9)
run file: mainfunction_medical_img_prepost.m function is used to run this example.
Download the dataset of the resection surgery from the website:
http://www.spl.harvard.edu/publications/item/view/1915
The zip file ResectionDataset2010.zip is to be extracted. We have the pre-operative
image volume (PreOp.img and PreOp.hdr) and post-operative (PreOp.img and PreOp.hdr).
Store all the four files ie. PreOp.hdr, PreOp.img, PostOp.hdr and PostOp.img files
in medical_images folder. There will a GUI window opened and under the drop down
menu of the ReadData3D window select under ‘Image file format’ ad ‘HDR/IMG Analyze
(*hdr)’ and click Load. Similarly do that for PostOp.img file. The read3DImage_prepost.m
file stores the image margins and makes the images of equal size. The images are
then used as the input for the image registration algorithm. The output file containing
the resulting output of the accuracy, number of control points, etc is written in
output_file_prepost.txt file on line 26 of the main function file. Modify filename
as per the example. To set the parameters, modify the setparameters_prepost.m function
on line 17.
5. Registration of liver CT images (Fig. 8)
run file: mainfunction_medical_img_liverCT.m function is used to run this example.
The image files are to be downloaded from http://www.insight-journal.org/midas/collection/view/38
Click on Original Datasets and download Patient01.mha and Patient04.mha files and
save them in the medical_images folder. The read3Dimage_liverCT.m file reads the
.mha files and resizes the images to make the sizes equal. Rigid alignment of the
images is carried out using imregister() function in MATLAB with "rigid" option.
The output image matrices are then registered in the non-rigid framework in our code.
The output file containing the resulting output of the accuracy, number of control
points, etc is written in output_file_liver.txt file. Modify filename as per the
example. To set the parameters, modify the setparameters_liver.m function given on
line 17.
6. Registration of brain MR T1 set of images (Fig. 7)
run file: mainfunction_medical_img_brainT1.m function is used to run this example.
The images of two subjects 105 and 109 were taken from http://www.insight-journal.org/rire/download_data.php
The mr_T1 files were downloaded and converted to readable format as the input to
the code. The files to be used are patient_105_mr_T1.mha and patient_109_mr_T1.mha.
The image files are already present in the converted .mha format for ease of use. There
is no need to download the files from the website. The output file containing the
resulting output of the accuracy, number of control points, etc is written in output_file_brainMR_T1.txt
file. Modify filename as per the example. To set the parameters, modify the setparameters_mr_T1.m
function given on line 17.