How to increase the figure size in Html output R Markdown (Knitr) - r-markdown

I have generated an output file with R markdown (see below)
In the image the figures are displayed in the HTML file but much smaller than the text alignment. I tried adjusting the width of the image but it doesnt change this in the output file. I want the image to be as wide as the gray bars. How can I adjust this?

Related

Cimg is increasing the size of the original image

I am using Cimg to modify an image(original size 145 KB). I add few lines of text and save it which is increasing the size the of the image to almost 900KB. So I tried to save the original image itself to see, but that too is saving the image with 900KB. How can I maintain the size or minimize the size of the image being saved. Please suggest a solution to resolve the same.

Distorted Image in Secondary Capture DICOM file

I want to create a secondary capture DICOM file as per the requirements.
I created one, but the image( pixel data in the tag 7FE0 0010 ) looks distorted. I am reading a JPEG image using Gdiplus::Bitmap and using API ::LockBits and 'btmpData.Scan0' to get the pixel data. The same is inserted into the pixel data tag - 7FE0,0010. But while viewing the same in a DICOM viewer, it is coming as distorted. The dicom tags Rows, Columns, PlannarConfiguration are updated properly. BitsAllocated, BitsStored and HighBit are given values 8,8 and 7 respectively.
While goggling I came to know that, instead of RGB format, the bits might be in the order BGR. Hence I tried to switch the bits in the place 'B' and 'R'.
But still the issue exist. Could anybody help me ?
Apparently you forgot to take into account Stride support from GDI+. An image being much more explicit than 1000 words here is what I mean:, the actual full article being here.

Correct display of DICOM images ITK-VTK (images too dark)

I read dicom images with ITK using itk::ImageSeriesReader and itk::GDCMImageIO after reading i flip the images with itk::FlipImageFilter (to get right orientation of the images) and convert the itkImageData to vtkImageData using itk::ImageToVTKImageFilter. I visualization images with VTK using vtkResliceImageViewer in QVTKWidget2.
I set:
(vtkResliceImageViewer)m_imageViewer[i]->SetColorWindow(windowWidthTAGvalue[0028|1051]);
(vtkResliceImageViewer)m_imageViewer[i]->SetColorLevel(windowCenterTAGvalue[0028|1050]);
and i set following blac&white LookUpTable:
vtkLookupTable* lutbw = vtkLookupTable::New();
lutbw->SetTableRange(0,1000);
lutbw->SetSaturationRange(0,0);
lutbw->SetHueRange(0,0);
lutbw->SetValueRange(0,1);
lutbw->Build();
And images shown into my software compared with the same images shown into other software are much darker, i can not get the same effect as other DICOM viewers
My software images are right other software image is left also when i use some other LookUpTable in this example Flow i can not get the same effect (2nd row images) my image on right is much darker then other.
What i am missing why my images are darker what can i do? i was research a lot into dicom and ikt/vtk can not find good solution any help is appreciate.
Please check the values for Rescale Slope (0028,1053) and Rescale Intercept(0028,1052) and apply the Modality LUT transformation before applying the Window level.
Your dataset may have VOI LUT Function (0028,1056) attribute value of "SIGMOID" instead of "LINEAR".
I extracted the image data from one of your DICOM file (brain_009.dcm) and looked at the histogram of the image data. It looks like, the minimum value stored in the image is 0 and maximum value is 960 regardless of interpreting the data is signed or unsigned. Also, the Window Width (0028:1051) has an invalid value of “0” and you cannot use that for displaying the image.
So your default display could set the Window Width to 960 and Window Center to half the window width plus the minimum value.

How to remove background from binary image in opencv?

I have images like the following:
I want to extract the background (in other words I want make a new image without the characters) so that i substract from the original image the background image resulting a new image with only the characters.
I know how crop the letters but it's not what i need.
This is the background:
This is the desired output:

Image file corruption when trying to resize and convert file

I'm trying to resize a .PNG file and convert it to .jpg.
I have been having issues with some PNG where the transparant background will turn into blocky orange with lines going through it and the semi-transparent shadows will turn into block black.
Here is my code:
<cfimage
action="convert"
source="#app_sysfilepath_site#images\wheels\Large\#serverfile#"
destination="#app_sysfilepath_site#images\wheels\Large\#replace(serverfile,'.png', '-1000.jpg')#">
<cfimage action = "resize"
height = "1000"
width="1000"
source = "#app_sysfilepath_site#images\wheels\Large\#replace(serverfile, '.png', '-1000.jpg')#"
destination = "#app_sysfilepath_site#images\wheels\Large\#replace(serverfile, '.png', '-1000.jpg')#"
overwrite = "yes">
Funny thing is this happens on some PNG's but not on others.
I remember having some issues in the past with .png files. There are four types of png's of which I am aware:
PNG-8 (256 colors)
PNG-24 (16 million colors)
PNG-32 (support full Alpha Transparency)
PNG (Fireworks layered)
If i had to guess i would say that you are having problems with png-32 files. I advice you to check your function with these different file types, and see which one produces the bad result.