I doing an image service to decompress dicom images ans save them as BMP(using dcmtk). Incase of jpeg2000 it is adviced to use OpenJPEG(2.1.1). How can i pass the compressed image to OpenJPEG and get Uncompressed image back. Suggestions are welcomed..
Here is a simple way, since you are receiving DICOM with JPEG 2000 encapsulated stream in it, simply pass the DICOM directly to GDCM to uncompress it. Then forward the decompressed DICOM to your regular DCMTK pipeline:
$ gdcmconv --raw input_jp2.dcm output_raw.dcm
GDCM by default is build with OpenJPEG 2.1.x.
Of course, if you are familiar with C++, you could directly call the C++ API directly, in particular have a look at the class gdcm::ImageChangeTransferSyntax.
Reference:
http://gdcm.sourceforge.net/html/gdcmconv.html
Related
I am transforming avi and wmv to flv format so that I can alfresco preview
Here is the steps I followed
Installed ffmpeg 64 bit static build on my windows machine
Remove .sample extension of video-thumbnail-context.xml.sample and video-transformation-context.xml.sample
Copied the properties mentioned in the two files to alfresco global properties (do I need to specify the path of ffmpeg in global properties?)
Created transform and copy rule for a folder and pointed to new folder
But I am getting error when uploading (Failure: Transformer for 'video/x-ms-wmv' source mime type and 'video/x-msvideo' target mime type was not found. Operation can't be performed)
Have you tried using the following addon? Which does basically everything for you.
The code is public via Googlecode (maybe also in the share-extras git).
What I've read is that you need to add the ffmpeg location, like:
ffmpeg.exe=C:/FFmpeg/bin/ffmpeg.exe
I am trying to convert mp3 file to raw file using NACL Plugin, I am using av_open_input_file() function of libavformat/avformat.h which is under ffmpeg library. This function should return 0 but it is returning -2. Syntax for my function call is below:-
if(av_open_input_file(&pFormatCtx, infile_name.c_str(), NULL, 0, NULL)!=0)
Can any one tell me what is the problem with this call?
I am using NACL pepper_25 toolchain, I am not sure whether this toolchain will support av_open_input_file() call or not but when I am compiling my program without using NACL it works fine.
The error codes from ffmpeg seem to be the same as standard POSIX errno values, only negative. So -2 is equivalent to ENOENT. I'm guessing this means that the file does not exist.
Please note that you cannot access your local filesystem directly when using NaCl, so if you want to use read/write calls, you'll need to use the nacl_io library. Take a look at the examples/demo/nacl_io example, and the documentation here: https://developers.google.com/native-client/dev/devguide/coding/nacl_io.
I have a receive pipeline with only a flat file dissambler in the dissamble stage,
but I need to change the encoding. The incoming file isn't utf-8 but it should be when it comes out.
See Tomas Restrepo's Fix Message Encoding Custom Pipeline Component here:
https://github.com/tomasr/fixencoding/tree/master/Winterdom.BizTalk.Samples.FixEncoding
Since the incoming file is not UTF-8 and you are using a flatfile disassembler, it means you must have defined a flat file XSD in your project. You use this flat file XSD in your pipeline componet at disassemble stage.
If the above is true, the easiest fix is to use the code page in your flat file schama(XSD) rather than the pipeline component or writing a custom pipeline component just to fix encoding. The screenshot below shows where you can set the source encoding.
I am looking for ASN.1 files for GSM-MAP and INAP protocols. I tried to search in 3gpp.org but couldn't find it.
Any help would be appreciated.
The GSM MAP operations are detailed in 29.002, the corresponding asn1 file is available at following link
http://www.3gpp.org/ftp/specs/archive/29_series/29.002/ASN.1/29002%207f0%20ASN1.zip
It is possible, that compiling above asn files identifies additional asn files - require another round of downloads from 3gpp. For example, the supplementary services are detailed in 24.080 (link to download corresponding ASN.1 files follows).
http://www.3gpp.org/ftp/specs/archive/24_series/24.080/ASN.1/24080-920%20ASN1.zip
For INAP, download the asn1 files for Q.1248 (zip file with all modules required to compile this recommendation) from ITU. ITU download link below.
For CAMEL, download the 29.078 3gpp specification at following link, the asn text file is attached included in the archive.
http://www.3gpp.org/ftp/Specs/archive/29_series/29.078/29078-920.zip
If you use INAP-CS1 (Capability Set 1), download ETS 300 374-1 protocol specification (http://www.etsi.org/deliver/etsi_i_ets/300300_300399/30037401/01_60/ets_30037401e01p.pdf). This ETS is based on ITU-T Recommendation Q.1218 (1993) ("Interface Recommendation for intelligent network CS1"). This document is here https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-Q.1218-199303-S!!PDF-E&type=items . ASN.1 files for Q.1218 are here http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=3232&showfl=1
Is there a way to get a file's mimetype in Flex SDK 3.5 without using its extension?
I need to validate if an uploaded file is of a certain kind. This is for images, or documents (PDF, ODT, etc.)
All the solutions I've found are by checking its extension. What if I rename a .odt file as a .jpg? Then I can upload it as an image...
I should add, we are using an AIR desktop client and a Java EE server. File checking is solved on the Java side, but the idea is not to go to the server, validate the file so if it's not valid, there's no network traffic at all.
Not really. Files do not have an inherent MIME type. The MIME type of arbitrary content data is described in the header of the internet protocol used to transport the data (such as HTTP, SMTP, RTP, etc.).
The only other solution I could think of off the top of my head is using a trial-and-error process where you have a guess at the file type you're dealing with, and you test that guess by actually opening the file (in your code) and testing for success. But that's ugly.
Steav, your solution just looks at the response header, which might not be set correctly.
Easiest way would be using php, if possible:
$fileinfo['content-type'];