Git Product home page Git Product logo

mazurowski-lab / mri-deeplearning-tutorial Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 3.0 1.28 MB

Source code for my blog post tutorial about how to use deep learning on MR images.

Home Page: https://sites.duke.edu/mazurowski/2022/07/13/breast-mri-cancer-detect-tutorial-part1/

License: MIT License

Jupyter Notebook 100.00%
breast-mri cancer-detection classification convolutional-neural-networks deep-learning neural-network pytorch tutorial

mri-deeplearning-tutorial's Introduction

MRI-deeplearning-tutorial

Source code for my blog post tutorial series about how to use deep learning on MR images, using our lab's Duke Breast Cancer MRI dataset.

Blog Post Links:

Part 1

Part 2

mri-deeplearning-tutorial's People

Contributors

nickk124 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mri-deeplearning-tutorial's Issues

No such file or directory error

Hey,
I'm trying to implement your amazing tutorial but keeps giving me this error.
FileNotFoundError: [Errno 2] No such file or directory: 'D:/manifest-1654812109500/Duke-Breast-Cancer-MRI/Breast_MRI_001/1.3.6.1.4.1.14519.5.2.1.186051521067863971269584893740842397538/1.3.6.1.4.1.14519.5.2.1.185777849803665244536713316058283493877/1-01.dcm'
this is my paths definition:

data_path = 'D:/manifest-1654812109500'
boxes_path = 'D:/Annotation_Boxes.csv'
mapping_path = 'D:/Breast-Cancer-MRI-filepath_filename-mapping.csv'
target_png_dir = 'png_out'
if not os.path.exists(target_png_dir):
	 #os.makedirs(target_png_dir)

the completed message:

FileNotFoundError                         Traceback (most recent call last)
~\AppData\Local\Temp\7\ipykernel_8036\3333985462.py in save_dcm_slice(dcm_fname, label, vol_idx)
     14         try:
---> 15             dcm = pydicom.dcmread(dcm_fname)
     16         except FileNotFoundError:

C:\ProgramData\Anaconda3\lib\site-packages\pydicom\filereader.py in dcmread(fp, defer_size, stop_before_pixels, force, specific_tags)
    992         logger.debug("Reading file '{0}'".format(fp))
--> 993         fp = open(fp, 'rb')
    994     elif fp is None or not hasattr(fp, "read") or not hasattr(fp, "seek"):

FileNotFoundError: [Errno 2] No such file or directory: 'D:/manifest-1654812109500\\Duke-Breast-Cancer-MRI/Breast_MRI_001/1.3.6.1.4.1.14519.5.2.1.186051521067863971269584893740842397538/1.3.6.1.4.1.14519.5.2.1.185777849803665244536713316058283493877/1-001.dcm'

During handling of the above exception, another exception occurred:

FileNotFoundError                         Traceback (most recent call last)
~\AppData\Local\Temp\7\ipykernel_8036\536749713.py in <module>
     39                 if ct_negative >= N_class:
     40                         continue
---> 41                 save_dcm_slice(dcm_fname, 0, vol_idx)
     42                 ct_negative += 1

~\AppData\Local\Temp\7\ipykernel_8036\3333985462.py in save_dcm_slice(dcm_fname, label, vol_idx)
     25             dcm_fname_split[-1] = dcm_fname_end
     26             dcm_fname = '/'.join(dcm_fname_split)
---> 27             dcm = pydicom.dcmread(dcm_fname)
     28 
     29 

C:\ProgramData\Anaconda3\lib\site-packages\pydicom\filereader.py in dcmread(fp, defer_size, stop_before_pixels, force, specific_tags)
    991         caller_owns_file = False
    992         logger.debug("Reading file '{0}'".format(fp))
--> 993         fp = open(fp, 'rb')
    994     elif fp is None or not hasattr(fp, "read") or not hasattr(fp, "seek"):
    995         raise TypeError("dcmread: Expected a file path or a file-like, "

FileNotFoundError: [Errno 2] No such file or directory: 'D:/manifest-1654812109500\\Duke-Breast-Cancer-MRI/Breast_MRI_001/1.3.6.1.4.1.14519.5.2.1.186051521067863971269584893740842397538/1.3.6.1.4.1.14519.5.2.1.185777849803665244536713316058283493877/1-01.dcm'

The error is occurring because the Dicom files are stored with other paths, not the default you set in your code
1-001.dcm
for example:
D:\manifest-1654812109500\Duke-Breast-Cancer-MRI\Breast_MRI_001\01-01-1990-NA-MRI BREAST BILATERAL WWO-97538\8.000000-ax dyn 2nd pass-92755

Is there an easy way please to deal with this path issue ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.