muschellij2 / dcmtk

Wrapper for 'DICOM' Toolkit ('DCMTK')
2 stars 1 forks source link

dcmj2pnm error: Too many parameters #2

Closed dkgaraujo closed 3 years ago

dkgaraujo commented 3 years ago

After installing from GitHub, I tried running dcmj2pnm on the DCM files from Kaggle's challenge "OSIC Pulmonary Fibrosis Progression" but was not successful in turning the pictures into JPEGs or PNMs. I always get the following message: "error: Too many parameters".

Here's what I did and the error I get, both in R and in the Mac Terminal (dcmtk was installed from R):

/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm /Coding/R/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00007637202177411956430/1.dcm --write-jpeg '/Coding/R/Kaggle - OSIC/test.jpg'

`$dcmtk: dcmj2pnm v3.6.3 2018-02-05 $

dcmj2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP error: Too many parameters`

Any help is much appreciated. Thanks!

muschellij2 commented 3 years ago

That’s because there is a space in your path. I will note and fix it

On Sun, Sep 6, 2020 at 4:13 AM Douglas Araujo notifications@github.com wrote:

After installing from GitHub, I tried running dcmj2pnm on the DCM files from Kaggle's challenge "OSIC Pulmonary Fibrosis Progression" https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression but was not successful in turning the pictures into JPEGs or PNMs. I always get the following message: "error: Too many parameters".

Here's what I did and the error I get, both in R and in the Mac Terminal (dcmtk was installed from R):

/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm /Coding/R/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00007637202177411956430/1.dcm --write-jpeg '/Coding/R/Kaggle - OSIC/test.jpg'

`$dcmtk: dcmj2pnm v3.6.3 2018-02-05 $

dcmj2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP

error: Too many parameters`

Any help is much appreciated. Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/muschellij2/dcmtk/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLS74A3Y5GGXZURDCDLSENAENANCNFSM4Q4CKJWQ .

-- Best, John

muschellij2 commented 3 years ago

Restart R, run

remotes::install_github("muschellij2/dcmtk")

and let me know if that works.

dkgaraujo commented 3 years ago

Restart R, run

remotes::install_github("muschellij2/dcmtk")

and let me know if that works.

Many thanks for the quick response, that is much appreciated! Unfortunately things are still not running 100% for me. Please see below:

> dcmtk::dcmj2pnm("~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm", opts = "--write-jpeg", outfile = "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg")

/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm  '/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm' --write-jpeg  '~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg'

W: no data dictionary loaded, check environment variable: DCMDICTPATH
E: can't load data dictionary
F: No data dictionary
[1] "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg"
attr(,"input_file")
[1] "'/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm'"

Unfortunately the test.jpg file is not created at the destination.

Thank you again for your efforts to look into this. I know that dcmtk package is a wrapper, so if the issue is really lying on the dcmtk binary, please let me know so I can follow up with them.

muschellij2 commented 3 years ago

If you have a question, please provide a MCVE: https://stackoverflow.com/help/mcve. In any example, I recommend using a reproducible example using the reprex package ( https://github.com/tidyverse/reprex). Also, please include a sessioninfo::session_info() output.

You're passing the outfile with a space in it. See https://qanda.digipres.org/1053/is-it-problematic-to-include-spaces-in-file-names#:~:text=Please%20log%20in%20or%20register%20to%20add%20a%20comment .,-%2B1%20vote&text=%22File%20names%20should%20contain%20no,file%20names%20that%20contain%20spaces.

Best, John

On Mon, Sep 7, 2020 at 1:13 PM Douglas Araujo notifications@github.com wrote:

Restart R, run

remotes::install_github("muschellij2/dcmtk")

and let me know if that works.

Many thanks for the quick response, that is much appreciated! Unfortunately things are still not running 100% for me. Please see below:

dcmtk::dcmj2pnm("~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm", opts = "--write-jpeg", outfile = "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg")

/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm '/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm' --write-jpeg '~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg'

W: no data dictionary loaded, check environment variable: DCMDICTPATH E: can't load data dictionary F: No data dictionary [1] "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg" attr(,"input_file") [1] "'/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm'"

Unfortunately the test.jpg file is not created at the destination.

Thank you again for your efforts to look into this. I know that dcmtk package is a wrapper, so if the issue is really lying on the dcmtk binary, please let me know so I can follow up with them.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/muschellij2/dcmtk/issues/2#issuecomment-688443021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLTPVSJKHAD7OFW63ILSEUIDXANCNFSM4Q4CKJWQ .

muschellij2 commented 3 years ago

Try the new commit. Best, John

On Mon, Sep 7, 2020 at 1:19 PM John Muschelli muschellij2@gmail.com wrote:

If you have a question, please provide a MCVE: https://stackoverflow.com/help/mcve. In any example, I recommend using a reproducible example using the reprex package ( https://github.com/tidyverse/reprex). Also, please include a sessioninfo::session_info() output.

You're passing the outfile with a space in it. See https://qanda.digipres.org/1053/is-it-problematic-to-include-spaces-in-file-names#:~:text=Please%20log%20in%20or%20register%20to%20add%20a%20comment .,-%2B1%20vote&text=%22File%20names%20should%20contain%20no,file%20names%20that%20contain%20spaces.

Best, John

On Mon, Sep 7, 2020 at 1:13 PM Douglas Araujo notifications@github.com wrote:

Restart R, run

remotes::install_github("muschellij2/dcmtk")

and let me know if that works.

Many thanks for the quick response, that is much appreciated! Unfortunately things are still not running 100% for me. Please see below:

dcmtk::dcmj2pnm("~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm", opts = "--write-jpeg", outfile = "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg")

/Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm '/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm' --write-jpeg '~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg'

W: no data dictionary loaded, check environment variable: DCMDICTPATH E: can't load data dictionary F: No data dictionary [1] "~/Coding/Kaggle challenges/OSIC pulmonary fibrosis/test.jpg" attr(,"input_file") [1] "'/Users/douglasaraujo/Coding/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00336637202286801879145/1.dcm'"

Unfortunately the test.jpg file is not created at the destination.

Thank you again for your efforts to look into this. I know that dcmtk package is a wrapper, so if the issue is really lying on the dcmtk binary, please let me know so I can follow up with them.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/muschellij2/dcmtk/issues/2#issuecomment-688443021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLTPVSJKHAD7OFW63ILSEUIDXANCNFSM4Q4CKJWQ .

edmizac commented 8 months ago

That’s because there is a space in your path. I will note and fix it On Sun, Sep 6, 2020 at 4:13 AM Douglas Araujo @.***> wrote: After installing from GitHub, I tried running dcmj2pnm on the DCM files from Kaggle's challenge "OSIC Pulmonary Fibrosis Progression" https://www.kaggle.com/c/osic-pulmonary-fibrosis-progression but was not successful in turning the pictures into JPEGs or PNMs. I always get the following message: "error: Too many parameters". Here's what I did and the error I get, both in R and in the Mac Terminal (dcmtk was installed from R): /Library/Frameworks/R.framework/Versions/4.0/Resources/library/dcmtk/bin/dcmj2pnm /Coding/R/Kaggle challenges/OSIC pulmonary fibrosis/osic-pulmonary-fibrosis-progression/train/ID00007637202177411956430/1.dcm --write-jpeg '/Coding/R/Kaggle - OSIC/test.jpg' $dcmtk: dcmj2pnm v3.6.3 2018-02-05 $ dcmj2pnm: Convert DICOM images to PGM/PPM, PNG, TIFF, JPEG or BMP error: Too many parameters Any help is much appreciated. Thanks! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#2>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGPLS74A3Y5GGXZURDCDLSENAENANCNFSM4Q4CKJWQ . -- Best, John

I had the same error and removing spaces from the path solved it. Thanks!