Question

Write a python code to create a sinogram for a given slice using the SheppLogan Phantom....

Write a python code to create a sinogram for a given slice using the SheppLogan Phantom. Provide the following:

  1. A picture of the SheppLogan phantom at 256x 256 pixels
  2. Pictures of the sinogram obtained from projections of the SheppLogan phantom for a 360-degree rotations taken one and two degrees apart respectively. Comment on the size of the sinogram?

Homework Answers

Answer #1

The code for generating the sinogram is organized into three classes

1.SquarePaddedImage.cs:

if (originalWidth > originalHeight) { // Width is greater than height; so we pad background pixels at the top and bottom // of the image, so that the original image comes in the middle of the square block PaddedWidth = originalWidth; PaddedHeight = originalWidth; InitializePaddedPixels(); int diff = (PaddedHeight - originalHeight) / 2; for (int i = diff * PaddedWidth; i < diff * PaddedWidth + originalWidth * originalHeight; ++i) { Pixels8PaddedRed[i] = pixels8OriginalRed[i - diff * PaddedWidth]; Pixels8PaddedGreen[i] = pixels8OriginalGreen[i - diff * PaddedWidth]; Pixels8PaddedBlue[i] = pixels8OriginalBlue[i - diff * PaddedWidth]; } }

2.ImageRotation.cs

This class has the responsibility of rotating a square image by a given angle. For example, if the rotation angle is specified as 3 degrees, this class can perform such a rotation, and give the resulting pixel array as an output. Additionally, it can also output back the resulting bitmap.

3.Sinogram.cs

// Populate the sinogram buffer for (int k = 0; k < numberOfAngles; ++k) { angleDegrees = -k; // Just watch the console for large images. // It should go on until 180. Console.Write(k + " "); ir.RotateImage(angleDegrees); pixels8RotatedRed = ir.Pixels8RotatedRed; pixels8RotatedGreen = ir.Pixels8RotatedGreen; pixels8RotatedBlue = ir.Pixels8RotatedBlue; for (int i = 0; i < SquareWidth; ++i) { sum = 0; index1 = i * numberOfAngles + k; for (int j = 0; j < SquareHeight; ++j) { index2 = j * SquareWidth + i; red = pixels8RotatedRed[index2]; green = pixels8RotatedGreen[index2]; blue = pixels8RotatedBlue[index2]; gray = red * 0.3 + green * 0.59 + blue * 0.11; gray /= maxsum; sum += gray; } sinogramValues[index1] = Math.Exp(-sum); } }

4.validation

-shape of the sinograms,and

-intensities of the sinograms

I1 = imread('Fig1.png'); I = rgb2gray(I1); theta = 0:180; [R,xp] = radon(I,theta); imagesc(theta,xp,R); colormap(gray);




Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
write code using python or repl.it 1. List 4 attributes that you'd create for class "student"....
write code using python or repl.it 1. List 4 attributes that you'd create for class "student". 2. List 2 setters and 2 getters for class student including their parameters 3. Write the complete definition for class student including attributes and methods created above using the correct Python syntax. 4. Create one object of class student and print the values of all its attributes. You can either call the getter method or access the attribute directly using the dot notation.
Write a Python graphics program that draws the following shapes: •    window size: 250 x 250...
Write a Python graphics program that draws the following shapes: •    window size: 250 x 250 pixels with window title with your name •    big circle, 50 pixels radius with center at (125, 125) •    two green circles, 10 pixels radius; first one centered at (113, 113) and second centered at (137, 113) •    one red line, from (100, 150) to (150, 150) Then answer this, what do you see? (make this a comment in your code)
Write a python code to print (any given file) file as a csv format by using...
Write a python code to print (any given file) file as a csv format by using MRJob only. code must be able to run stand-alone MRJob application. For submission to your work: Your final hand should be a single file name BDM.py that takes exactly one arguments for the input path. output will be handled through redirection. Sample run: python BDM.py sample.csv > output.csv
**Python** Write code that will: Create a list using the following integers: 58, 98, 82, 69,...
**Python** Write code that will: Create a list using the following integers: 58, 98, 82, 69, 90, 74, 68, 88, 71, 44 Sort the list numerically from smallest to largest Iterate through the list that converts from a numerical grade (1-100) to a letter grade (A, B, C, D, F) and print the applicable grade to the console window, but preface each answer with “Your grade is : “ before the letter grade
Part One: Write a program to draw a picture by defining functions and using Turtle Graphics....
Part One: Write a program to draw a picture by defining functions and using Turtle Graphics. Use the following guidelines to write your program. Give your artwork a name. Print the name to the output Draw a picture using the turtle. You can pick the subject of your picture. Some suggestions include a house, a car, a face, a robot. At least two programmer-defined functions must be used. Use at least one color apart from black. The picture should include...
Python: Provide code and result Given 4 values x, y, s, and t. Write a one-line...
Python: Provide code and result Given 4 values x, y, s, and t. Write a one-line command to check if x > y or s > t. If yes, the code should output "True" We try to define a function in Figure 2, please identify two problems with the code. Write an inline if statement to assign x the value 1 if the variable y = 'female' and assign x the value 0 if the variable y = 'male'. The...
Using python, write the program below. Program Specifications: You are to write the source code and...
Using python, write the program below. Program Specifications: You are to write the source code and design tool for the following specification: A student enters an assignment score (as a floating-point value). The assignment score must be between 0 and 100. The program will enforce the domain of an assignment score. Once the score has been validated, the program will display the score followed by the appropriate letter grade (assume a 10-point grading scale). The score will be displayed as...
For the given table, write a code in python to delete the row if the row...
For the given table, write a code in python to delete the row if the row has more than 70% of it's values as 0 or Nan In the table there are 11 values in a row without considering ID and Name, so if there more than 7 values are null values then the row should be deleted. **code should be in python using pandas library ID Name a b c d e f g h i j k 7...
Using Python, write the following code. You are to allow the user to enter the daily...
Using Python, write the following code. You are to allow the user to enter the daily temperature as a floating-point number. You should make the assumption that you are recording temperatures in Fahrenheit. You should allow the user to continue entering temperatures until the value -999 is entered. This number should not be considered a temperature, but just a flag to stop the program. As the user enters a temperature, you should display the following each time: Current Temperature: 999...
WRITE USING PYTHON PROGRAMMING THE CODE GIVEN BELOW HAS SOME ERRORS WHICH NEED TO BE SOLVED....
WRITE USING PYTHON PROGRAMMING THE CODE GIVEN BELOW HAS SOME ERRORS WHICH NEED TO BE SOLVED. ALSO THE 2 POINTS MENTIONED BELOW SHOULD BE PRESENT IN THE CODE Write a script that calculates the 3 longest words of a text stored in a file and print them from the longest to the smaller of the 3. Please note: 1. The name of the file is word_list.csv and it doesn’t need to be asked to the user (meaning the name will...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT