{ "info": { "author": "FNNDSC", "author_email": "dev@babymri.org", "bugtrack_url": null, "classifiers": [], "description": "med2image\n=========\n\nQuick Overview\n--------------\n\n- Convert DICOM or NIfTI to jpg or png\n\nOverview\n--------\n\nmed2image is a simple Python3 utility that converts medical image\nformatted files to more visual friendly ones, such as png and jpg.\n\nCurrently, NIfTI and DICOM input formats are understood, while any\ngraphical output type that is supported by matplotlib can be generated.\n\nDependencies\n------------\n\nMake sure that the following dependencies are installed on your host\nsystem/python3 virtual env:\n\n- nibabel (to read NIfTI files)\n- pydicom (to read DICOM files)\n- matplotlib (to save data in various image formats)\n- pillow (to save data in jpg format)\n\nInstallation\n~~~~~~~~~~~~\n\nThe best method of installing this script and all of its dependencies is\nby fetching it from PyPI\n\n.. code:: bash\n\n pip3 install med2image\n\nYou migh get an error about `python3-tk` not installed. So you should install that package.\nFor example on Ubuntu:\n\n.. code:: bash\n\n sudo apt-get update\n sudo apt-get install -y python3-tk\n\n\nCommand line arguments\n----------------------\n\n::\n\n -i|--inputFile \n Input file to convert. Typically a DICOM file or a nifti volume.\n\n [-d|--outputDir ]\n The directory to contain the converted output image files.\n\n -o|--outputFileStem \n The output file stem to store conversion. If this is specified\n with an extension, this extension will be used to specify the\n output file type.\n\n SPECIAL CASES:\n For DICOM data, the can be set to the value of\n an internal DICOM tag. The tag is specified by preceding the tag\n name with a percent character '%', so\n\n -o %ProtocolName\n\n will use the DICOM 'ProtocolName' to name the output file. Note\n that special characters (like spaces) in the DICOM value are\n replaced by underscores '_'.\n\n Multiple tags can be specified, for example\n\n -o %PatientName%PatientID%ProtocolName\n\n and the output filename will have each DICOM tag string as\n specified in order, connected with dashes.\n\n A special %inputFile is available to specify the input file that\n was read (without extension).\n\n [-t|--outputFileType ]\n The output file type. If different to extension,\n will override extension in favour of .\n\n [-s|--sliceToConvert ]\n In the case of volume files, the slice (z) index to convert. Ignored\n for 2D input data. If a '-1' is sent, then convert *all* the slices.\n If an 'm' is specified, only convert the middle slice in an input\n volume.\n \n [-f|--frameToConvert ]\n In the case of 4D volume files, the volume (V) containing the\n slice (z) index to convert. Ignored for 3D input data. If a '-1' is \n sent, then convert *all* the frames. If an 'm' is specified, only \n convert the middle frame in the 4D input stack.\n\n [--showSlices]\n If specified, render/show image slices as they are created.\n\n [--reslice]\n For 3D data only. Assuming [i,j,k] coordinates, the default is to save\n along the 'k' direction. By passing a --reslice image data in the 'i' and\n 'j' directions are also saved. Furthermore, the is subdivided into\n 'slice' (k), 'row' (i), and 'col' (j) subdirectories.\n\n [-x|--man]\n Show full help.\n\n [-y|--synopsis]\n Show brief help.\n\nNIfTI conversion\n----------------\n\nBoth 3D and 4D NIfTI input data are understood. In the case of 4D NIfTI,\na specific frame can be specified in conjunction with a specific slice\nindex. In most cases, only a slice is required since most NIfTI data is\n3D. Furthermore, all slices can be converted, or just the middle one.\n\nExamples\n~~~~~~~~\n\nAll slices in a volume\n~~~~~~~~~~~~~~~~~~~~~~\n\nTo convert all slices in an input NIfTI volume called vol.nii, to save\nthe results in a directory called out and to use as output the file stem\nname image, do\n\n``med2image -i vol.nii -d out -o image.jpg -s -1``\n\nor equivalently and more verbosely,\n\n::\n\n med2image --inputFile vol.nii --outputDir out \\\n --outputFileStem image --outputFileType jpg \\\n --sliceToConvert -1\n\nThis will create the following files in out\n\n::\n\n image-slice000.jpg\n image-slice001.jpg\n image-slice002.jpg\n image-slice003.jpg\n image-slice004.jpg\n image-slice005.jpg\n image-slice006.jpg\n image-slice007.jpg\n ...\n image-slice049.jpg\n image-slice050.jpg\n image-slice051.jpg\n image-slice052.jpg\n image-slice053.jpg\n\nConvert only a single slice\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nMostly, you'll probably only want to convert the \"middle\" slice in a\nvolume (for example to generate a representative thumbnail of the\nvolume). To do this, simply specify a m to --sliceToConvert\n\n``med2image -i input.nii -o input.jpg -s m``\n\nor, again, slightly more verbosely and with an outputDirectory specifier\n\n``med2image -i input.nii -d out -o vol --outputFileType jpg --sliceToConvert m``\n\nAlternatively a specific slice index can be converted. Use\n\n``med2image -i input.nii -d out -o vol --outputFileType jpg --sliceToConvert 20``\n\nto convert only the 20th slice of the volume.\n\nDICOM conversion\n----------------\n\nConvert a single DICOM file\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo convert a single DICOM file called slice.dcm to slice.jpg, do:\n\n``med2image -i slice.dcm -o slice.jpg``\n\nwhich will create a single file, slice.jpg in the current directory.\n\nConvert all DICOMS in a directory/series\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo convert all the DICOMS in a directory, simply specifiy a '-1' to the\nsliceIndex:\n\n``med2image -i inputDir/slice.dcm -d outputDir -o slice.jpg -s -1``\n\nNote that this assumes all the DICOM files in the directory inputDir\nbelong to the same series.\n\nMultiple Direction Reslicing\n----------------------------\n\nBy default, only the slice (or slices) in the acquisition direction are\nconverted. However, by passing a -r to the script, all dimensions are\nconverted. Since the script does not know the anatomical orientation of\nthe image, the directions are simply labeled x, y, and z.\n\nThe z direction is the original acquistion (slice) direction, while x\nand y correspond to planes normal to the row and column directions.\n\nConverted images are stored in subdirectories labeled x, y, and z.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/FNNDSC/med2image", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "med2image", "package_url": "https://pypi.org/project/med2image/", "platform": "", "project_url": "https://pypi.org/project/med2image/", "project_urls": { "Homepage": "https://github.com/FNNDSC/med2image" }, "release_url": "https://pypi.org/project/med2image/1.1.2/", "requires_dist": null, "requires_python": "", "summary": "(Python) utility to convert medical images to jpg and png", "version": "1.1.2" }, "last_serial": 3845302, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "9be3e360b4d72c5a830c0c5990efa2d0", "sha256": "9db79e7515bd8b938d40c341b69b719a071c98c62485af2aa4fc1acc1ec8051c" }, "downloads": -1, "filename": "med2image-0.1.tar.gz", "has_sig": false, "md5_digest": "9be3e360b4d72c5a830c0c5990efa2d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25701, "upload_time": "2017-06-28T17:10:34", "url": "https://files.pythonhosted.org/packages/de/11/d6c19a93c32ef3a88933f3f79090861415589075f3866679426a1469dd55/med2image-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "4e57222a9a010e9ac13e0d162dc8f58d", "sha256": "216ab807e04730e13e2f90b5a0596309f899937122d1d9f215f2da08014b7ffa" }, "downloads": -1, "filename": "med2image-0.2.tar.gz", "has_sig": false, "md5_digest": "4e57222a9a010e9ac13e0d162dc8f58d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25701, "upload_time": "2017-06-28T18:13:18", "url": "https://files.pythonhosted.org/packages/15/d2/3588fb90538621fadc82eaf494d271b6435f56d51816f7c1461f93cd49aa/med2image-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "388f86f9308435c1fe4bc98815f758bc", "sha256": "acbb02134fcd3cdb85671aef3f5a4839f90353d19ef00a7000bc192a7a1d61bb" }, "downloads": -1, "filename": "med2image-0.3.tar.gz", "has_sig": false, "md5_digest": "388f86f9308435c1fe4bc98815f758bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24149, "upload_time": "2017-06-28T18:19:11", "url": "https://files.pythonhosted.org/packages/a3/b9/f0568621d9ac8d47308ad00456b620e52762b891377487b766b53bc532e5/med2image-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "422c9e62fb4bb88f865b903b9bad7128", "sha256": "8cebd19934c90397606fe7cfe0a32effdde296750ff9a72767a0dda3e6e0b09c" }, "downloads": -1, "filename": "med2image-0.4.tar.gz", "has_sig": false, "md5_digest": "422c9e62fb4bb88f865b903b9bad7128", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24149, "upload_time": "2017-06-28T18:30:05", "url": "https://files.pythonhosted.org/packages/1b/a1/6026cc05a41dab13e7f5ddb1b30f6dfe3656e05664144e609d5200b05092/med2image-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "d0b613829a4968fd6252d0eeef7fbd56", "sha256": "fc12c4c4302c76147f391e943a471b0298fd6b594fc9a28e598fb440927e5ca2" }, "downloads": -1, "filename": "med2image-0.5.tar.gz", "has_sig": false, "md5_digest": "d0b613829a4968fd6252d0eeef7fbd56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24196, "upload_time": "2017-06-28T19:41:04", "url": "https://files.pythonhosted.org/packages/02/b2/690efb3821347e4334d9c343001617929b43414b733c2db372cd762f5dcb/med2image-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "0948fde9062f4f5ad61828995f11a755", "sha256": "6d136d5f3844e96b4dccd68140133a97d815a99d1a48a079dfacb3fa8c4dc1ff" }, "downloads": -1, "filename": "med2image-0.6.tar.gz", "has_sig": false, "md5_digest": "0948fde9062f4f5ad61828995f11a755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24265, "upload_time": "2017-06-28T20:07:48", "url": "https://files.pythonhosted.org/packages/5c/3a/c8a67a4b703821ddfa8b17909e51d60574e774af973a9331ac111de142eb/med2image-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "30b24a480c805a84aa4ce41f73ca00d8", "sha256": "d39476cb7b7a1cb5ad572ace3f4fe0a695e9ec20f47a823266767c6eff32e9e8" }, "downloads": -1, "filename": "med2image-0.7.tar.gz", "has_sig": false, "md5_digest": "30b24a480c805a84aa4ce41f73ca00d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24269, "upload_time": "2017-06-28T20:17:56", "url": "https://files.pythonhosted.org/packages/cb/60/7f48e880b88303eef1566b7539803c9abb73724e527f8ec39d9632121063/med2image-0.7.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "3e30a7e8205d2fa8d7ba9ba4a812fa7f", "sha256": "b9c80a6fd0cf41c6fb494d9c9457ea35d4d5757b492b1fe9448f46171bc70324" }, "downloads": -1, "filename": "med2image-1.0.1.tar.gz", "has_sig": false, "md5_digest": "3e30a7e8205d2fa8d7ba9ba4a812fa7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28102, "upload_time": "2017-07-07T15:02:11", "url": "https://files.pythonhosted.org/packages/8a/b6/411cb6eece701aa0832c873e1aa7108c835a871a1e3cbfacba2d13b811dc/med2image-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "64811cd1db2a00e423e4f2d2a82ba849", "sha256": "5487222cc948f90ac3fdf621585cb7208892058d53396ce66789bbe746eb4b84" }, "downloads": -1, "filename": "med2image-1.0.2.tar.gz", "has_sig": false, "md5_digest": "64811cd1db2a00e423e4f2d2a82ba849", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28549, "upload_time": "2017-07-07T20:01:07", "url": "https://files.pythonhosted.org/packages/ea/c3/9cfa5ec50ff50ce088c8c8feb769001f43a0b1a733cedaedde1897e734d0/med2image-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "950ed5c15ec5c92d424b57f46f480e20", "sha256": "fa39815f322ffcfd35e0c5821ba6e37df8013eac431939d153bc076f710175fb" }, "downloads": -1, "filename": "med2image-1.0.3.tar.gz", "has_sig": false, "md5_digest": "950ed5c15ec5c92d424b57f46f480e20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28680, "upload_time": "2017-07-11T18:43:19", "url": "https://files.pythonhosted.org/packages/a3/9d/9bcb00de397d003043b02f44717dd06fa4d1dce4770dda998b479aceaf9c/med2image-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "f98dbfeb26e049350fb2df23fe5817d7", "sha256": "06d7a56a49971c517112ecbb11f73deca99aacc50dc5bbf4dded3524fc19bb35" }, "downloads": -1, "filename": "med2image-1.0.4.tar.gz", "has_sig": false, "md5_digest": "f98dbfeb26e049350fb2df23fe5817d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28704, "upload_time": "2017-07-13T13:58:44", "url": "https://files.pythonhosted.org/packages/88/65/22ebbd70dde16ee32e87e688e772079ea6f2051f89ebf7910a151807317f/med2image-1.0.4.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "8069f2b0a4f2d27ddf5e55720b973ae5", "sha256": "0ab25e97df6429f58cb8bcd7f31078651fd1c33a35ec56c8f337a17b6dd893f9" }, "downloads": -1, "filename": "med2image-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8069f2b0a4f2d27ddf5e55720b973ae5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27964, "upload_time": "2017-07-13T15:28:57", "url": "https://files.pythonhosted.org/packages/92/e0/551811f9b4436021605c9d52104866ecc7c71feba2542b3d77402e6c6076/med2image-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "78e8920fdea14d0d1a0284c4f9918453", "sha256": "8df296bc62f372c8ed080403d33eb606906ede7bd1b4e59c01732604b94e9af0" }, "downloads": -1, "filename": "med2image-1.1.1.tar.gz", "has_sig": false, "md5_digest": "78e8920fdea14d0d1a0284c4f9918453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29133, "upload_time": "2017-07-25T18:57:54", "url": "https://files.pythonhosted.org/packages/5b/78/1a7e82b48c05a838dd460d787d4d15709e4c1b5a8020073454d0096537ce/med2image-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "a531dbf190402864831251d20ea44b82", "sha256": "4722bec353953744f532e634d8f8421fbd5dc9edb571b4079fc21ed02adcc2e2" }, "downloads": -1, "filename": "med2image-1.1.2.tar.gz", "has_sig": false, "md5_digest": "a531dbf190402864831251d20ea44b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29152, "upload_time": "2018-05-08T19:57:38", "url": "https://files.pythonhosted.org/packages/6f/e5/948b023c7feb72adf7dfb26d90a13c838737bbf52be704f5ddd0878e3264/med2image-1.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a531dbf190402864831251d20ea44b82", "sha256": "4722bec353953744f532e634d8f8421fbd5dc9edb571b4079fc21ed02adcc2e2" }, "downloads": -1, "filename": "med2image-1.1.2.tar.gz", "has_sig": false, "md5_digest": "a531dbf190402864831251d20ea44b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29152, "upload_time": "2018-05-08T19:57:38", "url": "https://files.pythonhosted.org/packages/6f/e5/948b023c7feb72adf7dfb26d90a13c838737bbf52be704f5ddd0878e3264/med2image-1.1.2.tar.gz" } ] }