Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BLOT Valentin
QuasiAffineTransform
Commits
55377e60
Commit
55377e60
authored
Dec 04, 2017
by
Valentin Blot
Browse files
cleaning
parent
83a43720
Changes
1
Hide whitespace changes
Inline
Side-by-side
QuasiAffineTransform/tools/QATPhantom2D.cpp
deleted
100644 → 0
View file @
83a43720
/**
* @file QATPhantom2D.cpp
* @author David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
* @date Thu Jun 19 10:59:44 2008
*
* @brief 2D Phantom
*
*
*/
#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include "../common/mathematic.hpp"
#include "../tclap/CmdLine.h"
#include "../2D/image.hpp"
using
namespace
std
;
using
namespace
TCLAP
;
//Global Varialbe
int
SIZE
;
double
zoneplate
(
double
i
,
double
j
)
{
return
(
256
*
(
127.5
+
127.5
*
cos
(
(
1440.0
/
M_PI
)
/
(
1.0
+
512.0
/
(
sqrt
(
8
*
(
(
i
-
SIZE
/
2
)
*
(
i
-
SIZE
/
2
)
+
(
j
-
SIZE
/
2
)
*
(
j
-
SIZE
/
2
)
)
)
)
)
)
)
);
}
int
main
(
int
argc
,
char
**
argv
)
{
try
{
//CmdLine Parser generator
CmdLine
cmd
(
"Phantom image construction in dimension 2"
,
' '
,
"0.1"
);
ValueArg
<
int
>
imageSize
(
"s"
,
"size"
,
"image size"
,
true
,
512
,
"size"
);
cmd
.
add
(
imageSize
);
// Parse the argv array.
cmd
.
parse
(
argc
,
argv
);
SIZE
=
imageSize
.
getValue
();
Image
output
(
SIZE
,
SIZE
);
double
grey
;
Color
c
;
for
(
unsigned
int
i
=
0
;
i
<
SIZE
;
i
++
)
for
(
unsigned
int
j
=
0
;
j
<
SIZE
;
j
++
)
{
grey
=
(
int
)
rint
(
zoneplate
(
i
,
j
));
c
.
blue
(
grey
);
c
.
red
(
grey
);
c
.
green
(
grey
);
output
.
setColor
(
i
,
j
,
c
);
}
output
.
write
(
"zoneplate.png"
);
}
catch
(
ArgException
&
e
)
// catch any exceptions
{
std
::
cerr
<<
"error: "
<<
e
.
error
()
<<
" for arg "
<<
e
.
argId
()
<<
std
::
endl
;
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment